main.yml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. name: Build
  2. on: [push, pull_request]
  3. jobs:
  4. desktop:
  5. name: ${{ matrix.platform.name }}
  6. runs-on: ${{ matrix.platform.os }}
  7. defaults:
  8. run:
  9. shell: sh
  10. strategy:
  11. fail-fast: false
  12. matrix:
  13. platform: # !!! FIXME: figure out an efficient way to get SDL2 on the Windows/Mac bots.
  14. - { name: Linux, os: ubuntu-latest }
  15. - { name: MinGW, os: windows-latest, flags: -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_SYSTEM_NAME=Windows }
  16. - { name: Windows, os: windows-latest, msvc: true }
  17. - { name: macOS, os: macos-latest }
  18. steps:
  19. - name: Get PhysicsFS sources
  20. uses: actions/checkout@v6
  21. - uses: ilammy/msvc-dev-cmd@v1
  22. if: ${{ !!matrix.platform.msvc }}
  23. with:
  24. arch: x64
  25. - name: Set up ninja
  26. uses: ./.github/actions/setup-ninja
  27. - name: Configure (CMake)
  28. run: |
  29. cmake -B build -GNinja \
  30. -DCMAKE_BUILD_TYPE=Release \
  31. -DCMAKE_INSTALL_PREFIX=prefix_cmake \
  32. ${{ matrix.platform.flags }}
  33. - name: Build (CMake)
  34. run: |
  35. cmake --build build/ --verbose
  36. - name: Install (CMake)
  37. run: |
  38. set -eu
  39. cmake --install build/
  40. echo "PhysFS_ROOT=$(pwd)/prefix_cmake" >> $GITHUB_ENV
  41. - name: Verify CMake configuration files
  42. run: |
  43. cmake -S cmake/test -B cmake_config_build \
  44. -DCMAKE_BUILD_TYPE=Release \
  45. -DTEST_SHARED=${{ matrix.platform.shared }} \
  46. -DTEST_STATIC=${{ matrix.platform.static }}
  47. cmake --build cmake_config_build --verbose
  48. - name: 'Test versioning'
  49. run: |
  50. build-scripts/test-versioning.sh
  51. os2:
  52. name: OS/2
  53. runs-on: ubuntu-latest
  54. steps:
  55. - uses: actions/checkout@v6
  56. - uses: open-watcom/setup-watcom@v0
  57. - name: Build physfs.dll
  58. run: |
  59. cd src
  60. wmake -sn -f Makefile.os2
  61. - name: distclean
  62. run: |
  63. cd src
  64. wmake -sn -f Makefile.os2 distclean