1
0

main.yml 2.0 KB

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