ci.yml 4.0 KB

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