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