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 && '-' || ''}}${{ matrix.scons_args }}
24+ EM_VERSION : 3.1.64
25+ EM_CACHE_FOLDER : " emsdk-cache"
26+ SCONS_CACHE : .scons-cache
27+
2328 strategy :
2429 fail-fast : false
2530 matrix :
2631 target : [ template_debug, template_release ]
27- identifier : [ windows, linux, macos, android, android_arm64 ]
32+ identifier : [ windows, linux, macos, android, android_arm64, web_threads, web_nothreads ]
2833
2934 include :
3035 # Defaults
3136 - runner : ubuntu-22.04
3237 - optimize : speed
3338 - arch : x86_64
39+ - scons_args :
3440
3541 # Debug build settings
3642 - target : template_debug
5561 platform : android
5662 arch : arm64
5763
64+ - identifier : web_threads
65+ platform : web
66+ arch : wasm32
67+ scons_args : threads=yes
68+
69+ - identifier : web_nothreads
70+ platform : web
71+ arch : wasm32
72+ scons_args : threads=no
73+
5874 steps :
5975 - name : Check settings
6076 if : ${{ matrix.platform == '' || matrix.target == '' || matrix.runner == '' || matrix.optimize == '' || matrix.arch == ''}}
@@ -95,6 +111,20 @@ jobs:
95111 ndk-version : r23c
96112 link-to-sdk : true
97113
114+ - name : (Web) Set up Emscripten cache
115+ if : ${{ matrix.platform == 'web' }}
116+ uses : actions/cache@v4
117+ with :
118+ path : ${{env.EM_CACHE_FOLDER}}
119+ key : ${{env.EM_VERSION}}-${{ env.BUILD_ID }}
120+
121+ - name : (Web) Set up Emscripten
122+ if : ${{ matrix.platform == 'web' }}
123+ uses : mymindstorm/setup-emsdk@v14
124+ with :
125+ version : ${{env.EM_VERSION}}
126+ actions-cache-folder : ${{env.EM_CACHE_FOLDER}}
127+
98128 - name : Set up Python
99129 uses : actions/setup-python@v5
100130 with :
@@ -113,35 +143,18 @@ jobs:
113143 submodules : recursive
114144 ref : ${{ inputs.git-ref }}
115145
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-
131146 - name : Scons Cache
132147 id : scons-cache
133148 uses : actions/cache@v4
134149 with :
135- path : .scons-cache
150+ path : ${{ env.SCONS_CACHE }}
136151 key : ${{ env.BUILD_ID }}
137152
138153 - name : Compile extension
139154 shell : sh
140- env :
141- SCONS_CACHE : .scons-cache
142155 run : |
143- scons target=' ${{ matrix.target }}' platform=' ${{ matrix.platform }}' arch=' ${{ matrix.arch }}' optimize=${{ matrix.optimize }} -j2
144- ls -l demo/addons/* /bin/
156+ scons -j2 target=${{ matrix.target }} platform=${{ matrix.platform }} arch=${{ matrix.arch }} optimize=${{ matrix.optimize }} lto=full ${{ matrix.scons_args }}
157+ ls -l demo/addons/ropesim /bin/
145158
146159 - name : Prepare files for publish
147160 shell : sh
0 commit comments