emscripten.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. -Wdeprecated -Wdev -Werror \
  22. -DSDL_WERROR=ON \
  23. -DSDL_TESTS=ON \
  24. -DSDL_INSTALL_TESTS=ON \
  25. -DCMAKE_BUILD_TYPE=Release \
  26. -DCMAKE_INSTALL_PREFIX=prefix \
  27. -GNinja
  28. - name: Build
  29. run: cmake --build build/ --verbose
  30. - name: Run build-time tests
  31. run: |
  32. set -eu
  33. export SDL_TESTS_QUICK=1
  34. # FIXME: enable Emscripten build time tests
  35. # ctest -VV --test-dir build/
  36. - name: Install
  37. run: |
  38. echo "SDL3_DIR=$(pwd)/prefix" >> $GITHUB_ENV
  39. cmake --install build/
  40. - name: Verify CMake configuration files
  41. run: |
  42. emcmake cmake -S cmake/test -B cmake_config_build \
  43. -DCMAKE_BUILD_TYPE=Release \
  44. -DSDL_VENDOR_INFO="Github Workflow" \
  45. -DTEST_SHARED=FALSE \
  46. -DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }}
  47. cmake --build cmake_config_build --verbose