web_builds.yml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. name: 🌐 Web Builds
  2. on:
  3. workflow_call:
  4. # Global Settings
  5. env:
  6. # Used for the cache key. Add version suffix to force clean build.
  7. GODOT_BASE_BRANCH: 4.3
  8. SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no use_closure_compiler=yes
  9. EM_VERSION: 3.1.64
  10. EM_CACHE_FOLDER: "emsdk-cache"
  11. concurrency:
  12. group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-web
  13. cancel-in-progress: true
  14. jobs:
  15. web-template:
  16. runs-on: "ubuntu-22.04"
  17. name: ${{ matrix.name }}
  18. strategy:
  19. fail-fast: false
  20. matrix:
  21. include:
  22. - name: Template w/ threads (target=template_release, threads=yes)
  23. cache-name: web-template
  24. target: template_release
  25. sconsflags: threads=yes
  26. tests: false
  27. artifact: true
  28. - name: Template w/o threads (target=template_release, threads=no)
  29. cache-name: web-nothreads-template
  30. target: template_release
  31. sconsflags: threads=no
  32. tests: false
  33. artifact: true
  34. steps:
  35. - uses: actions/checkout@v4
  36. with:
  37. submodules: recursive
  38. - name: Set up Emscripten latest
  39. uses: mymindstorm/setup-emsdk@v14
  40. with:
  41. version: ${{env.EM_VERSION}}
  42. actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
  43. cache-key: emsdk-${{ matrix.cache-name }}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
  44. - name: Verify Emscripten setup
  45. run: |
  46. emcc -v
  47. - name: Restore Godot build cache
  48. uses: ./.github/actions/godot-cache-restore
  49. with:
  50. cache-name: ${{ matrix.cache-name }}
  51. continue-on-error: true
  52. - name: Setup Python and SCons
  53. uses: ./.github/actions/godot-deps
  54. - name: Compilation
  55. uses: ./.github/actions/godot-build
  56. with:
  57. sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
  58. platform: web
  59. target: ${{ matrix.target }}
  60. tests: ${{ matrix.tests }}
  61. - name: Save Godot build cache
  62. uses: ./.github/actions/godot-cache-save
  63. with:
  64. cache-name: ${{ matrix.cache-name }}
  65. continue-on-error: true
  66. - name: Upload artifact
  67. uses: ./.github/actions/upload-artifact
  68. if: ${{ matrix.artifact }}
  69. with:
  70. name: ${{ matrix.cache-name }}