ci.yml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. name: CI
  2. on:
  3. # on each push and manual trigger
  4. push:
  5. branches: [ master ]
  6. paths-ignore: [ "**/Readme.md" ]
  7. workflow_dispatch:
  8. jobs:
  9. build:
  10. runs-on: ${{ matrix.operating-system }}
  11. strategy:
  12. matrix:
  13. operating-system: [ubuntu-latest, windows-latest, macos-latest]
  14. # currently stable="Lazarus 3.0 / FPC 3.2.2" with [email protected]
  15. lazarus-versions: [stable]
  16. steps:
  17. - uses: actions/checkout@v4
  18. - name: Install Lazarus
  19. uses: gcarreno/setup-lazarus@v3
  20. with:
  21. lazarus-version: ${{ matrix.lazarus-versions }}
  22. - name: Print Lazarus version
  23. run: lazbuild --version
  24. - name: Setup Linux
  25. if: runner.os == 'Linux'
  26. shell: bash
  27. run: |
  28. # needed for SDL and GL demos
  29. sudo apt install libsdl1.2-dev -y
  30. # to build LCL demos with Qt5 backend
  31. # sudo apt install libqt5pas-dev -y
  32. # With current Lazarus + Ubuntu versions we need to get newer libqt5pas release
  33. # (https://forum.lazarus.freepascal.org/index.php/topic,65619.msg500216.html#msg500216)
  34. wget https://github.com/davidbannon/libqt5pas/releases/download/v1.2.15/libqt5pas1_2.15-1_amd64.deb
  35. sudo apt install ./libqt5pas1_2.15-1_amd64.deb -y
  36. wget https://github.com/davidbannon/libqt5pas/releases/download/v1.2.15/libqt5pas-dev_2.15-1_amd64.deb
  37. sudo apt install ./libqt5pas-dev_2.15-1_amd64.deb -y
  38. - name: Build demos with FPC (Linux)
  39. if: runner.os == 'Linux'
  40. shell: bash
  41. run: |
  42. cd Scripts
  43. ./BuildDemosFPC.sh
  44. ./BuildExtDemosFPC.sh
  45. ./Clean.sh --clean-also-bin-dirs
  46. - name: Build demos with FPC (Windows)
  47. if: runner.os == 'Windows'
  48. shell: bash
  49. run: |
  50. cd Scripts
  51. ./BuildDemosFPC.bat
  52. ./BuildExtDemosFPC.bat
  53. ./Clean.sh --clean-also-bin-dirs
  54. - name: Build demos with Lazarus
  55. shell: bash
  56. run: |
  57. cd Demos/ObjectPascal
  58. # Built for all platforms
  59. lazbuild --bm="Release" "Benchmark/Bench.lpi"
  60. lazbuild --bm="Release" "VampConvert/VampConvert.lpi"
  61. if [ "$RUNNER_OS" == "Linux" ]; then
  62. # For Linux build LCL demos also with Qt5 (just to test that it builds)
  63. lazbuild --ws=qt5 --bm="Release" "LCLImager/lclimager.lpi"
  64. lazbuild --ws=qt5 --bm="Release" "ImageBrowser/ImgBrowser.lpi"
  65. fi
  66. if [ "$RUNNER_OS" != "macOS" ]; then
  67. # Build these for non macOS platforms
  68. lazbuild --bm="Release" "LCLImager/lclimager.lpi"
  69. lazbuild --bm="Release" "ImageBrowser/ImgBrowser.lpi"
  70. lazbuild --bm="Release" "OpenGLDemo/OpenGLDemo.lpi"
  71. lazbuild --bm="Release" "SDLDemo/SDLDemo.lpi"
  72. fi
  73. if [ "$RUNNER_OS" == "Windows" ]; then
  74. # Build D3D demo just for Windows
  75. lazbuild --bm="Release" "D3DDemo/D3DDemo.lpi"
  76. fi
  77. if [ "$RUNNER_OS" == "macOS" ]; then
  78. # For macOS we need to build LCL demos with Cocoa
  79. lazbuild --ws=cocoa --bm="Release" "LCLImager/lclimager.lpi"
  80. lazbuild --ws=cocoa --bm="Release" "ImageBrowser/ImgBrowser.lpi"
  81. fi
  82. - name: List Demos Bin directory
  83. shell: bash
  84. run: ls Demos/Bin
  85. - name: Run demos
  86. shell: bash
  87. run: |
  88. cd Demos/Bin
  89. ./Bench
  90. ./VampConvert -h
  91. - name: Compile Lazarus Packages
  92. shell: bash
  93. run: |
  94. lazbuild "Packages/VampyreImagingPackage.lpk"
  95. lazbuild "Packages/VampyreImagingPackageExt.lpk"
  96. - uses: actions/upload-artifact@v4
  97. with:
  98. name: ci-artifacts-${{ matrix.operating-system }}-laz-${{ matrix.lazarus-versions }}
  99. # exclude compiled units etc.
  100. path: |
  101. Demos/Bin
  102. !Demos/Bin/Dcu
  103. if-no-files-found: error