main.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. -DPHYSFS_INSTALL_MAN=ON \
  33. ${{ matrix.platform.flags }}
  34. - name: Build (CMake)
  35. run: |
  36. cmake --build build/ --verbose
  37. - name: Install (CMake)
  38. run: |
  39. set -eu
  40. cmake --install build/
  41. echo "PhysFS_ROOT=$(pwd)/prefix_cmake" >> $GITHUB_ENV
  42. - name: Verify CMake configuration files
  43. run: |
  44. cmake -S cmake/test -B cmake_config_build \
  45. -DCMAKE_BUILD_TYPE=Release \
  46. -DTEST_SHARED=${{ matrix.platform.shared }} \
  47. -DTEST_STATIC=${{ matrix.platform.static }}
  48. cmake --build cmake_config_build --verbose
  49. - name: 'Test versioning'
  50. run: |
  51. build-scripts/test-versioning.sh
  52. os2:
  53. name: OS/2
  54. runs-on: ubuntu-latest
  55. steps:
  56. - uses: actions/checkout@v6
  57. - uses: open-watcom/setup-watcom@v0
  58. - name: Build physfs.dll
  59. run: |
  60. cd src
  61. wmake -sn -f Makefile.os2
  62. - name: distclean
  63. run: |
  64. cd src
  65. wmake -sn -f Makefile.os2 distclean