1717jobs :
1818 build :
1919 runs-on : ${{ matrix.runner }}
20- name : ${{ matrix.platform }} ${{ matrix.target }} ${{ matrix.arch }} ${{ matrix.optimize }}
20+ name : ${{ matrix.platform }} ${{ matrix.target }} ${{ matrix.arch }} ${{ matrix.optimize }} ${{ matrix.scons_args }}
21+
2122 env :
22- BUILD_ID : ${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.arch }}-${{ matrix.optimize }}
23+ BUILD_ID : ${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.arch }}-${{ matrix.optimize }}-${{ matrix.scons_args }}
24+ EM_VERSION : 4.0.9
25+ EM_CACHE_FOLDER : " emsdk-cache"
26+
2327 strategy :
2428 fail-fast : false
2529 matrix :
2630 target : [ template_debug, template_release ]
27- identifier : [ windows, linux, macos, android, android_arm64 ]
31+ identifier : [ windows, linux, macos, android, android_arm64, web ]
2832
2933 include :
3034 # Defaults
3135 - runner : ubuntu-22.04
3236 - optimize : speed
3337 - arch : x86_64
38+ - scons_args :
3439
3540 # Debug build settings
3641 - target : template_debug
5560 platform : android
5661 arch : arm64
5762
63+ - identifier : web
64+ platform : web
65+ arch : wasm32
66+ scons_args : threads=no
67+
5868 steps :
5969 - name : Check settings
6070 if : ${{ matrix.platform == '' || matrix.target == '' || matrix.runner == '' || matrix.optimize == '' || matrix.arch == ''}}
@@ -95,6 +105,20 @@ jobs:
95105 ndk-version : r23c
96106 link-to-sdk : true
97107
108+ - name : (Web) Set up Emscripten cache
109+ if : ${{ matrix.platform == 'web' }}
110+ uses : actions/cache@v4
111+ with :
112+ path : ${{env.EM_CACHE_FOLDER}}
113+ key : ${{env.EM_VERSION}}-${{ env.BUILD_ID }}
114+
115+ - name : (Web) Set up Emscripten
116+ if : ${{ matrix.platform == 'web' }}
117+ uses : mymindstorm/setup-emsdk@v14
118+ with :
119+ version : ${{env.EM_VERSION}}
120+ actions-cache-folder : ${{env.EM_CACHE_FOLDER}}
121+
98122 - name : Set up Python
99123 uses : actions/setup-python@v5
100124 with :
@@ -113,21 +137,6 @@ jobs:
113137 submodules : recursive
114138 ref : ${{ inputs.git-ref }}
115139
116- # TODO: Cache doesn't work yet. SCons rebuilds the objects even if they already exist. Could be caused by modification dates or extension_api.json.
117- # fetch-depth: 0 May be needed for cache. See: <https://github.com/actions/checkout/issues/468>.
118- # - name: Set up SCons cache
119- # uses: actions/cache@v3
120- # with:
121- # path: |
122- # ${{ github.workspace }}/.scons-cache/
123- # ${{ github.workspace }}/**/.sconsign.dblite
124- # ${{ github.workspace }}/godot-cpp/gen/
125- # key: ${{ matrix.platform }}-${{ github.ref }}-${{ github.sha }}
126- # restore-keys: |
127- # ${{ matrix.platform }}-${{ github.ref }}-${{ github.sha }}
128- # ${{ matrix.platform }}-${{ github.ref }}
129- # ${{ matrix.platform }}
130-
131140 - name : Scons Cache
132141 id : scons-cache
133142 uses : actions/cache@v4
@@ -140,7 +149,7 @@ jobs:
140149 env :
141150 SCONS_CACHE : .scons-cache
142151 run : |
143- scons target='${{ matrix.target }}' platform='${{ matrix.platform }}' arch='${{ matrix.arch }}' optimize=${{ matrix.optimize }} -j2
152+ scons target='${{ matrix.target }}' platform='${{ matrix.platform }}' arch='${{ matrix.arch }}' optimize=${{ matrix.optimize }} ${{ matrix.scons_args }} -j2
144153 ls -l demo/addons/*/bin/
145154
146155 - name : Prepare files for publish
0 commit comments