File tree Expand file tree Collapse file tree 4 files changed +18
-4
lines changed
Expand file tree Collapse file tree 4 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,10 @@ be https://ziglang.org/download to avoid the official website being hit with lar
4545If you've experienced issues with a default mirror, please open an issue, and I will communicate with the
4646mirror's owner or remove it from the list.
4747
48+ If necessary, the caching of the global Zig cache directory can be disabled by setting the option
49+ `use-cache : false`. Don't do this without reason: preserving the Zig cache will typically speed things up
50+ and decrease the load on GitHub's runners.
51+
4852[mach-nominated] : https://machengine.org/about/nominated-zig/
4953
5054# # Details
Original file line number Diff line number Diff line change 99 description : ' Override of Zig download mirror to use, e.g. "https://pkg.machengine.org/zig".'
1010 required : false
1111 default : ' '
12+ use-cache :
13+ description : ' Whether to cache the global Zig cache directory.'
14+ required : true
15+ default : true
1216runs :
1317 using : ' node20'
1418 main : ' main.js'
Original file line number Diff line number Diff line change @@ -105,9 +105,13 @@ async function main() {
105105 }
106106
107107 core . addPath ( zig_dir ) ;
108- await cache . restoreCache ( [ await common . getZigCachePath ( ) ] , await common . getCachePrefix ( ) ) ;
108+
109109 // Direct Zig to use the global cache as every local cache, so that we get maximum benefit from the caching above.
110110 core . exportVariable ( 'ZIG_LOCAL_CACHE_DIR' , await common . getZigCachePath ( ) ) ;
111+
112+ if ( core . getBooleanInput ( 'use-cache' ) ) {
113+ await cache . restoreCache ( [ await common . getZigCachePath ( ) ] , await common . getCachePrefix ( ) ) ;
114+ }
111115 } catch ( err ) {
112116 core . setFailed ( err . message ) ;
113117 }
Original file line number Diff line number Diff line change @@ -5,9 +5,11 @@ const common = require('./common');
55
66async function main ( ) {
77 try {
8- const prefix = await common . getCachePrefix ( ) ;
9- const name = prefix + github . context . runId ;
10- await cache . saveCache ( [ await common . getZigCachePath ( ) ] , name ) ;
8+ if ( core . getBooleanInput ( 'use-cache' ) ) {
9+ const prefix = await common . getCachePrefix ( ) ;
10+ const name = prefix + github . context . runId ;
11+ await cache . saveCache ( [ await common . getZigCachePath ( ) ] , name ) ;
12+ }
1113 } catch ( err ) {
1214 core . setFailed ( err . message ) ;
1315 }
You can’t perform that action at this time.
0 commit comments