File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1313 - stable
1414 - testing
1515 - unstable
16+ - cache-nim
1617 pull_request :
1718 paths-ignore : ['media/**', 'docs/**', '**/*.md']
1819 branches-ignore :
@@ -157,11 +158,47 @@ jobs:
157158 echo "ncpu=${ncpu}" >> $GITHUB_ENV
158159 echo "make_cmd=${make_cmd}" >> $GITHUB_ENV
159160
161+
162+ - name : Get Nim commit hash
163+ id : nim-hash
164+ run : |
165+ BRANCH="${{ matrix.branch }}"
166+ HASH=$(curl -s "https://api.github.com/repos/nim-lang/Nim/branches/${{ matrix.branch }}" | jq -r .commit.sha)
167+ echo "NIM_COMMIT_HASH=$HASH" >> $GITHUB_ENV
168+ echo "nim_commit_hash=$HASH" >> $GITHUB_OUTPUT
169+
170+ - name : Restore Nim build from cache
171+ id : nim-cache
172+ uses : actions/cache@v4
173+ with :
174+ path : |
175+ nim/bin
176+ nim/config
177+ nim/lib
178+ nim/nim.nimble
179+ key : nim-${{ matrix.branch }}-${{ steps.nim-hash.outputs.nim_commit_hash }}-${{ matrix.target.os }}-${{ matrix.target.cpu }}
180+
160181 - name : Build Nim and Nimbus dependencies
182+ if : steps.nim-cache.outputs.cache-hit != 'true'
161183 run : |
162184 ${make_cmd} -j ${ncpu} NIM_COMMIT=${{ matrix.branch }} ARCH_OVERRIDE=${PLATFORM} QUICK_AND_DIRTY_COMPILER=1 update
163185 ./env.sh nim --version
164186
187+ - name : Save Nim build to cache
188+ if : steps.nim-cache.outputs.cache-hit != 'true'
189+ uses : actions/cache@v4
190+ with :
191+ path : |
192+ nim/bin
193+ nim/config
194+ nim/lib
195+ nim/nim.nimble
196+ key : nim-${{ matrix.branch }}-${{ steps.nim-hash.outputs.nim_commit_hash }}-${{ matrix.target.os }}-${{ matrix.target.cpu }}
197+
198+ - name : Add Nim bin to GITHUB_PATH
199+ run : echo '${{ github.workspace }}/nim/bin' >> $GITHUB_PATH
200+
201+
165202 - name : Build binaries (with trace logging enabled)
166203 run : |
167204 ${make_cmd} -j ${ncpu} V=1 NIM_COMMIT=${{ matrix.branch }} LOG_LEVEL=TRACE NIMFLAGS="-u:release --opt:none ${NIMFLAGS}"
You can’t perform that action at this time.
0 commit comments