File tree Expand file tree Collapse file tree 5 files changed +25
-8
lines changed
Expand file tree Collapse file tree 5 files changed +25
-8
lines changed Original file line number Diff line number Diff line change 1919 runs-on : ${{ matrix.runner }}
2020 name : ${{ matrix.platform }} ${{ matrix.target }} ${{ matrix.arch }} ${{ matrix.optimize }}
2121 env :
22- ARTIFACT_NAME : ${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.arch }}-${{ matrix.optimize }}
22+ BUILD_ID : ${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.arch }}-${{ matrix.optimize }}
2323 strategy :
2424 fail-fast : false
2525 matrix :
@@ -128,11 +128,17 @@ jobs:
128128# ${{ matrix.platform }}-${{ github.ref }}
129129# ${{ matrix.platform }}
130130
131+ - name : Scons Cache
132+ id : scons-cache
133+ uses : actions/cache@v4
134+ with :
135+ path : .scons-cache
136+ key : ${{ env.BUILD_ID }}
137+
131138 - name : Compile extension
132139 shell : sh
133- # env:
134- # SCONS_CACHE: '${{ github.workspace }}/.scons-cache/'
135- # SCONS_CACHE_LIMIT: 8192
140+ env :
141+ SCONS_CACHE : .scons-cache
136142 run : |
137143 scons target='${{ matrix.target }}' platform='${{ matrix.platform }}' arch='${{ matrix.arch }}' optimize=${{ matrix.optimize }} -j2
138144 ls -l demo/addons/*/bin/
@@ -147,15 +153,18 @@ jobs:
147153 - name : Upload artifact
148154 uses : actions/upload-artifact@v4
149155 with :
150- name : build-${{ env.ARTIFACT_NAME }}
156+ name : build-${{ env.BUILD_ID }}
151157 path : |
152158 ${{ github.workspace }}/demo/
153159 merge :
154160 runs-on : ubuntu-latest
155161 needs : build
156162 steps :
163+ - name : Git describe
164+ id : ghd
165+ uses : proudust/gh-describe@v2
157166 - name : Merge Artifacts
158167 uses : actions/upload-artifact/merge@v4
159168 with :
160- name : ${{ github.event.repository.name }}
169+ name : ${{ github.event.repository.name }}-${{ steps.ghd.outputs.describe }}
161170 pattern : build-*
Original file line number Diff line number Diff line change 1+ .scons_cache_debug
12.vim
23* .pyc
34* .idx
Original file line number Diff line number Diff line change @@ -29,6 +29,13 @@ opts.Update(env)
2929env .Append (CCFLAGS = "-fdiagnostics-color" )
3030
3131
32+ scons_cache_path = os .environ .get ("SCONS_CACHE" )
33+ if scons_cache_path :
34+ os .makedirs (scons_cache_path , exist_ok = True )
35+ CacheDir (scons_cache_path )
36+ print ("Using cache dir:" , scons_cache_path )
37+
38+
3239# Sources
3340env .Append (CPPPATH = ["src/" ])
3441sources = Glob ("src/*.cpp" )
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- scons compiledb=yes optimize=debug use_llvm=yes
3+ SCONS_CACHE= " $PWD /.scons_cache_debug " scons compiledb=yes optimize=debug use_llvm=yes " $@ "
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- scons optimize=speed target=template_release
3+ scons optimize=speed target=template_release " $@ "
You can’t perform that action at this time.
0 commit comments