Skip to content

CI: add build job to test with FPC+Lazarus trunk builds #149

CI: add build job to test with FPC+Lazarus trunk builds

CI: add build job to test with FPC+Lazarus trunk builds #149

Workflow file for this run

name: CI
on:
# on each push and manual trigger
push:
branches: [ master ]
paths-ignore: [ "**/Readme.md" ]
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: build (${{ matrix.operating-system }}, ${{ matrix.arch }})
runs-on: ${{ matrix.operating-system }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
# Windows x86_64
- operating-system: windows-latest
arch: x86_64
laz-url: https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Lazarus%204.8/lazarus-4.8-fpc-3.2.2-win64.exe
fpc-url: https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Lazarus%204.8/lazarus-4.8-fpc-3.2.2-cross-i386-win32-win64.exe
# Ubuntu x86_64
- operating-system: ubuntu-latest
arch: x86_64
laz-url: https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%204.8/lazarus-project_4.8.0-0_amd64.deb
fpc-url: |
https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%204.8/fpc-laz_3.2.2-210709_amd64.deb
https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%204.8/fpc-src_3.2.2-210709_amd64.deb
# Ubuntu ARM64
- operating-system: ubuntu-24.04-arm
arch: arm64
laz-url: https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20arm64%20DEB/Lazarus%204.8/lazarus-project_4.8.0-0_arm64.deb
fpc-url: |
https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20arm64%20DEB/Lazarus%204.8/fpc-laz_3.2.3-240813_arm64.deb
https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20arm64%20DEB/Lazarus%204.8/fpc-src_3.2.3-240813_arm64.deb
# macOS ARM64
- operating-system: macos-latest
arch: arm64
laz-url: https://sourceforge.net/projects/lazarus/files/Lazarus%20macOS%20aarch64/Lazarus%204.8/lazarus-darwin-aarch64-4.8.zip
fpc-url: https://sourceforge.net/projects/lazarus/files/Lazarus%20macOS%20aarch64/Lazarus%204.8/fpc-3.2.4rc1a.intelarm64-macosx.dmg
# macOS x86_64
- operating-system: macos-15-intel
arch: x86_64
laz-url: https://sourceforge.net/projects/lazarus/files/Lazarus%20macOS%20x86-64/Lazarus%204.8/lazarus-darwin-x86_64-4.8.zip
fpc-url: https://sourceforge.net/projects/lazarus/files/Lazarus%20macOS%20x86-64/Lazarus%204.8/fpc-3.2.4rc1a.intelarm64-macosx.dmg
steps:
- uses: actions/checkout@v7
- name: Install FPC & Lazarus
uses: ollydev/setup-lazarus@v4.1
with:
laz-url: ${{ matrix.laz-url }}
fpc-url: ${{ matrix.fpc-url }}
- name: Verify script executable bits (Git tree)
shell: bash
run: |
# Check that CI and other scripts are executable. Git on Windows can break the exec flag if you edit the file there and commit.
FAIL=0
for FILE in Scripts/*.sh; do
MODE="$(git ls-files -s "$FILE" | awk '{print $1}')"
if [ "$MODE" != "100755" ]; then
echo "::error file=$FILE::Missing executable bit in Git tree (mode $MODE)"
FAIL=1
fi
done
exit $FAIL
- name: Setup Windows
if: runner.os == 'Windows'
shell: bash
run: |
# Add FPC to PATH
LAZ_DIR="$RUNNER_TEMP/lazarus"
FPC_BIN=$(find "$LAZ_DIR/" -type f -executable -name "fpc.exe" | head -1)
FPC_DIR=$(dirname "$FPC_BIN")
echo "Found FPC: $FPC_BIN"
echo "$FPC_DIR" >> $GITHUB_PATH
# Check Win32 cross compiler is available
FPC_CROSS_WIN32_BIN=$(find "$LAZ_DIR/" -name "ppc386.exe" | head -1)
if [ ! -f "$FPC_CROSS_WIN32_BIN" ]; then
echo "Error: Win32 cross compiler not found!"
exit 1
fi
- name: Setup Linux
if: runner.os == 'Linux'
shell: bash
run: ./Scripts/CI.SetupLinux.sh
- name: Setup macOS
if: runner.os == 'macOS'
shell: bash
run: |
brew untap aws/tap 2>/dev/null || true # Silence the warnings on macOS runners, we don't need AWS stuff
brew install bash # We need bash 4+
brew install sdl2 sdl12-compat
- name: Print info
shell: bash
run: ./Scripts/CI.PrintInfo.sh
- name: Build demos with FPC
shell: bash
run: ./Scripts/CI.BuildDemosFPC.sh
- name: Build demos with Lazarus
shell: bash
run: ./Scripts/CI.BuildDemosLazarus.sh
- name: Build Lazarus packages
shell: bash
run: |
lazbuild "Packages/VampyreImagingPackage.lpk"
lazbuild "Packages/VampyreImagingPackageExt.lpk"
- name: Run demos
shell: bash
run: ./Scripts/CI.RunDemos.sh
- name: List Demos Bin directory
shell: bash
run: ls Demos/Bin
- uses: actions/upload-artifact@v7
with:
name: ci-artifacts-${{ runner.os }}-${{ runner.arch }}
path: |
Demos
!Demos/ObjectPascal
!Demos/Bin/Dcu
if-no-files-found: error
# Extra non-critical job: test FPC trunk compiler via fpclazup on Ubuntu
build-fpc-trunk:
runs-on: ubuntu-latest
continue-on-error: true
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
- name: Install Lazarus + FPC trunk (fpclazup)
uses: ollydev/setup-lazarus@v4.1
with:
fpclazup-url: https://github.com/LongDirtyAnimAlf/Reiniero-fpcup/releases/download/v2.4.0i/fpclazup-x86_64-linux
fpclazup-lazcommit: a3e4c43c3d # Lazarus 4.99-5622 2026-07-16
fpclazup-fpccommit: ad4da509ba # FPC trunk 3.3.1-20578 2026-07-16
- name: Setup Linux
if: runner.os == 'Linux'
shell: bash
run: ./Scripts/CI.SetupLinux.sh
- name: Print info
shell: bash
run: ./Scripts/CI.PrintInfo.sh
- name: Build demos with Lazarus
shell: bash
run: ./Scripts/CI.BuildDemosLazarus.sh
- name: Run demos
shell: bash
run: ./Scripts/CI.RunDemos.sh
- name: Report trunk build outcome
if: always()
run: |
if [ "${{ job.status }}" = "failure" ]; then
echo "::warning::Build with FPC + Lazarus trunk failed."
fi
- uses: actions/upload-artifact@v7
with:
name: ci-artifacts-trunk-build-${{ runner.os }}-${{ runner.arch }}
path: |
Demos
!Demos/ObjectPascal
!Demos/Bin/Dcu
if-no-files-found: error