emscripten.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. name: Build (Emscripten)
  2. on: [push, pull_request]
  3. concurrency:
  4. group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
  5. cancel-in-progress: true
  6. jobs:
  7. emscripten:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - uses: actions/checkout@v3
  11. - uses: mymindstorm/setup-emsdk@v10
  12. with:
  13. version: 2.0.32
  14. - name: Install ninja
  15. run: |
  16. sudo apt-get -y update
  17. sudo apt-get install -y ninja-build
  18. - name: Configure CMake
  19. run: |
  20. emcmake cmake -S . -B build \
  21. -DSDL_WERROR=ON \
  22. -DSDL_TESTS=ON \
  23. -DSDL_INSTALL_TESTS=ON \
  24. -DCMAKE_BUILD_TYPE=Release \
  25. -DCMAKE_INSTALL_PREFIX=prefix \
  26. -GNinja
  27. - name: Build
  28. run: cmake --build build/ --verbose
  29. - name: Run build-time tests
  30. run: |
  31. set -eu
  32. export SDL_TESTS_QUICK=1
  33. # FIXME: enable Emscripten build time tests
  34. # ctest -VV --test-dir build/
  35. - name: Install
  36. run: |
  37. echo "SDL3_DIR=$(pwd)/prefix" >> $GITHUB_ENV
  38. cmake --install build/
  39. - name: Verify CMake configuration files
  40. run: |
  41. emcmake cmake -S cmake/test -B cmake_config_build \
  42. -DCMAKE_BUILD_TYPE=Release \
  43. -DSDL_VENDOR_INFO="Github Workflow" \
  44. -DTEST_SHARED=FALSE \
  45. -DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }}
  46. cmake --build cmake_config_build --verbose