OverviewFilesCommitsIssuesDocsReleasesPeers

nvidia-rtx-godot / .github / workflows / web_builds.yml

78 lines · yaml ref:
name: 🌐 Web Builds
on:
  workflow_call:
  workflow_dispatch:

# Global Settings
env:
  SCONS_FLAGS: >-
    dev_mode=yes
    debug_symbols=no
    use_closure_compiler=yes
  EM_VERSION: 4.0.11

jobs:
  web-template:
    runs-on: ubuntu-24.04
    name: ${{ matrix.name }}
    timeout-minutes: 60
    strategy:
      fail-fast: false
      matrix:
        include:
          - name: Template w/ threads, 64-bit (target=template_release, threads=yes, arch=wasm64)
            cache-name: web-template
            target: template_release
            scons-flags: threads=yes arch=wasm64
            artifact: true

          - name: Template w/o threads, 32-bit (target=template_release, threads=no, arch=wasm32)
            cache-name: web-nothreads-template
            target: template_release
            scons-flags: threads=no arch=wasm32
            artifact: true

    steps:
      - name: Checkout
        uses: actions/checkout@v6
        with:
          submodules: recursive

      - name: Set up Emscripten latest
        uses: ./.github/actions/setup-emsdk
        with:
          version: ${{ env.EM_VERSION }}
          no-cache: true

      - name: Verify Emscripten setup
        run: |
          emcc -v

      - name: Restore Godot build cache
        uses: ./.github/actions/godot-cache-restore
        with:
          cache-name: ${{ matrix.cache-name }}
        continue-on-error: true

      - name: Setup Python and SCons
        uses: ./.github/actions/godot-deps

      - name: Compilation
        uses: ./.github/actions/godot-build
        with:
          scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.scons-flags }}
          platform: web
          target: ${{ matrix.target }}

      - name: Save Godot build cache
        uses: ./.github/actions/godot-cache-save
        with:
          cache-name: ${{ matrix.cache-name }}
        continue-on-error: true

      - name: Upload artifact
        uses: ./.github/actions/upload-artifact
        if: matrix.artifact
        with:
          name: ${{ matrix.cache-name }}