2022-08-28 18:27:45 +00:00
|
|
|
name: 🌐 Web Builds
|
2023-04-04 13:56:53 +00:00
|
|
|
on:
|
|
|
|
workflow_call:
|
2020-07-23 21:21:26 +00:00
|
|
|
|
2020-10-09 20:18:51 +00:00
|
|
|
# Global Settings
|
2020-07-23 21:21:26 +00:00
|
|
|
env:
|
2023-05-18 14:22:25 +00:00
|
|
|
# Used for the cache key. Add version suffix to force clean build.
|
2020-07-24 06:20:42 +00:00
|
|
|
GODOT_BASE_BRANCH: master
|
2024-07-26 09:52:36 +00:00
|
|
|
SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no use_closure_compiler=yes
|
2024-08-08 09:17:35 +00:00
|
|
|
EM_VERSION: 3.1.64
|
2021-09-01 15:26:01 +00:00
|
|
|
EM_CACHE_FOLDER: "emsdk-cache"
|
2020-07-23 21:21:26 +00:00
|
|
|
|
2021-08-24 18:49:06 +00:00
|
|
|
concurrency:
|
2022-08-28 18:27:45 +00:00
|
|
|
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-web
|
2021-08-24 18:49:06 +00:00
|
|
|
cancel-in-progress: true
|
|
|
|
|
2020-07-23 21:21:26 +00:00
|
|
|
jobs:
|
2022-08-28 18:27:45 +00:00
|
|
|
web-template:
|
2023-09-05 12:56:53 +00:00
|
|
|
runs-on: "ubuntu-22.04"
|
2023-12-01 18:39:09 +00:00
|
|
|
name: ${{ matrix.name }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- name: Template w/ threads (target=template_release, threads=yes)
|
|
|
|
cache-name: web-template
|
|
|
|
target: template_release
|
|
|
|
sconsflags: threads=yes
|
|
|
|
tests: false
|
|
|
|
artifact: true
|
|
|
|
|
|
|
|
- name: Template w/o threads (target=template_release, threads=no)
|
|
|
|
cache-name: web-nothreads-template
|
|
|
|
target: template_release
|
|
|
|
sconsflags: threads=no
|
|
|
|
tests: false
|
|
|
|
artifact: true
|
2020-07-23 21:21:26 +00:00
|
|
|
|
|
|
|
steps:
|
2023-09-04 14:05:38 +00:00
|
|
|
- uses: actions/checkout@v4
|
2024-03-16 02:52:47 +00:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2020-07-23 21:21:26 +00:00
|
|
|
|
|
|
|
- name: Set up Emscripten latest
|
2024-01-25 11:13:22 +00:00
|
|
|
uses: mymindstorm/setup-emsdk@v14
|
2020-07-23 21:21:26 +00:00
|
|
|
with:
|
|
|
|
version: ${{env.EM_VERSION}}
|
|
|
|
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
|
2024-01-25 11:13:22 +00:00
|
|
|
cache-key: emsdk-${{ matrix.cache-name }}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
|
2020-07-23 21:21:26 +00:00
|
|
|
|
|
|
|
- name: Verify Emscripten setup
|
|
|
|
run: |
|
|
|
|
emcc -v
|
|
|
|
|
2024-07-13 13:50:30 +00:00
|
|
|
- name: Restore Godot build cache
|
|
|
|
uses: ./.github/actions/godot-cache-restore
|
2023-12-01 18:39:09 +00:00
|
|
|
with:
|
|
|
|
cache-name: ${{ matrix.cache-name }}
|
2021-09-01 15:26:01 +00:00
|
|
|
continue-on-error: true
|
|
|
|
|
2024-05-17 07:28:56 +00:00
|
|
|
- name: Setup Python and SCons
|
2021-09-01 15:26:01 +00:00
|
|
|
uses: ./.github/actions/godot-deps
|
2020-09-29 21:42:41 +00:00
|
|
|
|
2021-09-01 15:26:01 +00:00
|
|
|
- name: Compilation
|
|
|
|
uses: ./.github/actions/godot-build
|
2020-09-29 21:42:41 +00:00
|
|
|
with:
|
2023-12-01 18:39:09 +00:00
|
|
|
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
|
2022-08-28 18:27:45 +00:00
|
|
|
platform: web
|
2023-12-01 18:39:09 +00:00
|
|
|
target: ${{ matrix.target }}
|
|
|
|
tests: ${{ matrix.tests }}
|
2021-09-01 15:26:01 +00:00
|
|
|
|
2024-07-13 13:50:30 +00:00
|
|
|
- name: Save Godot build cache
|
|
|
|
uses: ./.github/actions/godot-cache-save
|
|
|
|
with:
|
|
|
|
cache-name: ${{ matrix.cache-name }}
|
|
|
|
continue-on-error: true
|
|
|
|
|
2021-09-01 15:26:01 +00:00
|
|
|
- name: Upload artifact
|
|
|
|
uses: ./.github/actions/upload-artifact
|
2023-12-01 18:39:09 +00:00
|
|
|
if: ${{ matrix.artifact }}
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.cache-name }}
|