name: CI on: # on each push and manual trigger push: branches: [ master ] paths-ignore: [ "**/Readme.md" ] workflow_dispatch: jobs: build: runs-on: ${{ matrix.operating-system }} strategy: matrix: # operating-system: [ubuntu-latest, windows-latest, macos-latest, macos-13] # currently stable="Lazarus 3.0 / FPC 3.2.2" with setup-lazarus@v3.2.17 lazarus-versions: [stable] steps: - uses: actions/checkout@v4 - name: Install Lazarus uses: gcarreno/setup-lazarus@v3 with: lazarus-version: ${{ matrix.lazarus-versions }} - name: Print Lazarus version run: lazbuild --version - name: Setup Linux if: runner.os == 'Linux' shell: bash run: | # needed for SDL and GL demos sudo apt install libsdl1.2-dev -y # to build LCL demos with Qt5 backend # sudo apt install libqt5pas-dev -y # With current Lazarus + Ubuntu versions we need to get newer libqt5pas release # (https://forum.lazarus.freepascal.org/index.php/topic,65619.msg500216.html#msg500216) wget https://github.com/davidbannon/libqt5pas/releases/download/v1.2.15/libqt5pas1_2.15-1_amd64.deb sudo apt install ./libqt5pas1_2.15-1_amd64.deb -y wget https://github.com/davidbannon/libqt5pas/releases/download/v1.2.15/libqt5pas-dev_2.15-1_amd64.deb sudo apt install ./libqt5pas-dev_2.15-1_amd64.deb -y - name: Build demos with FPC (Linux) if: runner.os == 'Linux' shell: bash run: | cd Scripts ./BuildDemosFPC.sh ./BuildExtDemosFPC.sh ./Clean.sh --clean-also-bin-dirs - name: Build demos with FPC (Windows) if: runner.os == 'Windows' shell: bash run: | cd Scripts ./BuildDemosFPC.bat ./BuildExtDemosFPC.bat ./Clean.sh --clean-also-bin-dirs - name: Build demos with Lazarus shell: bash run: | cd Demos/ObjectPascal # Built for all platforms lazbuild --bm="Release" "Benchmark/Bench.lpi" lazbuild --bm="Release" "VampConvert/VampConvert.lpi" if [ "$RUNNER_OS" == "Linux" ]; then # For Linux build LCL demos also with Qt5 (just to test that it builds) lazbuild --ws=qt5 --bm="Release" "LCLImager/lclimager.lpi" lazbuild --ws=qt5 --bm="Release" "ImageBrowser/ImgBrowser.lpi" fi if [ "$RUNNER_OS" != "macOS" ]; then # Build these for non macOS platforms lazbuild --bm="Release" "LCLImager/lclimager.lpi" lazbuild --bm="Release" "ImageBrowser/ImgBrowser.lpi" lazbuild --bm="Release" "OpenGLDemo/OpenGLDemo.lpi" lazbuild --bm="Release" "SDLDemo/SDLDemo.lpi" fi if [ "$RUNNER_OS" == "Windows" ]; then # Build D3D demo just for Windows lazbuild --bm="Release" "D3DDemo/D3DDemo.lpi" fi if [ "$RUNNER_OS" == "macOS" ]; then # For macOS we need to build LCL demos with Cocoa lazbuild --ws=cocoa --bm="Release" "LCLImager/lclimager.lpi" lazbuild --ws=cocoa --bm="Release" "ImageBrowser/ImgBrowser.lpi" fi - name: List Demos Bin directory shell: bash run: ls Demos/Bin - name: Run demos shell: bash run: | cd Demos/Bin ./Bench ./VampConvert -h - name: Compile Lazarus Packages shell: bash run: | lazbuild "Packages/VampyreImagingPackage.lpk" lazbuild "Packages/VampyreImagingPackageExt.lpk" - uses: actions/upload-artifact@v4 with: name: ci-artifacts-${{ matrix.operating-system }}-laz-${{ matrix.lazarus-versions }} # exclude compiled units etc. path: | Demos/Bin !Demos/Bin/Dcu if-no-files-found: error