2022-08-29 02:27:45 +08:00
|
|
|
name: 🌐 Web Builds
|
2023-04-04 21:56:53 +08:00
|
|
|
on:
|
|
|
|
workflow_call:
|
2020-07-24 05:21:26 +08:00
|
|
|
|
2020-10-10 04:18:51 +08:00
|
|
|
# Global Settings
|
2020-07-24 05:21:26 +08:00
|
|
|
env:
|
2023-05-18 22:22:25 +08:00
|
|
|
# Used for the cache key. Add version suffix to force clean build.
|
2020-07-24 14:20:42 +08:00
|
|
|
GODOT_BASE_BRANCH: master
|
2021-09-01 23:26:01 +08:00
|
|
|
SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no
|
2023-11-10 22:25:08 +08:00
|
|
|
EM_VERSION: 3.1.39
|
2021-09-01 23:26:01 +08:00
|
|
|
EM_CACHE_FOLDER: "emsdk-cache"
|
2020-07-24 05:21:26 +08:00
|
|
|
|
2021-08-25 02:49:06 +08:00
|
|
|
concurrency:
|
2022-08-29 02:27:45 +08:00
|
|
|
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-web
|
2021-08-25 02:49:06 +08:00
|
|
|
cancel-in-progress: true
|
|
|
|
|
2020-07-24 05:21:26 +08:00
|
|
|
jobs:
|
2022-08-29 02:27:45 +08:00
|
|
|
web-template:
|
2023-09-05 20:56:53 +08:00
|
|
|
runs-on: "ubuntu-22.04"
|
2023-12-02 02:39:09 +08: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-24 05:21:26 +08:00
|
|
|
|
|
|
|
steps:
|
2023-09-04 22:05:38 +08:00
|
|
|
- uses: actions/checkout@v4
|
2024-03-16 10:52:47 +08:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2020-07-24 05:21:26 +08:00
|
|
|
|
|
|
|
- name: Set up Emscripten latest
|
2024-01-25 19:13:22 +08:00
|
|
|
uses: mymindstorm/setup-emsdk@v14
|
2020-07-24 05:21:26 +08:00
|
|
|
with:
|
|
|
|
version: ${{env.EM_VERSION}}
|
|
|
|
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
|
2024-01-25 19:13:22 +08:00
|
|
|
cache-key: emsdk-${{ matrix.cache-name }}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
|
2020-07-24 05:21:26 +08:00
|
|
|
|
|
|
|
- name: Verify Emscripten setup
|
|
|
|
run: |
|
|
|
|
emcc -v
|
|
|
|
|
2021-09-01 23:26:01 +08:00
|
|
|
- name: Setup Godot build cache
|
|
|
|
uses: ./.github/actions/godot-cache
|
2023-12-02 02:39:09 +08:00
|
|
|
with:
|
|
|
|
cache-name: ${{ matrix.cache-name }}
|
2021-09-01 23:26:01 +08:00
|
|
|
continue-on-error: true
|
|
|
|
|
|
|
|
- name: Setup python and scons
|
|
|
|
uses: ./.github/actions/godot-deps
|
2020-09-30 05:42:41 +08:00
|
|
|
|
2021-09-01 23:26:01 +08:00
|
|
|
- name: Compilation
|
|
|
|
uses: ./.github/actions/godot-build
|
2020-09-30 05:42:41 +08:00
|
|
|
with:
|
2023-12-02 02:39:09 +08:00
|
|
|
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
|
2022-08-29 02:27:45 +08:00
|
|
|
platform: web
|
2023-12-02 02:39:09 +08:00
|
|
|
target: ${{ matrix.target }}
|
|
|
|
tests: ${{ matrix.tests }}
|
2021-09-01 23:26:01 +08:00
|
|
|
|
|
|
|
- name: Upload artifact
|
|
|
|
uses: ./.github/actions/upload-artifact
|
2023-12-02 02:39:09 +08:00
|
|
|
if: ${{ matrix.artifact }}
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.cache-name }}
|