File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9090 versionSpec : ' $(python.version)'
9191 architecture : ' $(python.architecture)'
9292
93+ - task : Cache@2
94+ inputs :
95+ key : ' microbits | "4.0"'
96+ path : $(Build.SourcesDirectory)/klayout-microbits
97+ cacheHitVar : MICROBITS_CACHED
98+ displayName : ' Cache KLayout microbits'
99+
93100 # Add additional tasks to run using each Python version in the matrix above
94101
95102 # PowerShell
@@ -100,9 +107,13 @@ jobs:
100107 # arguments: # Optional
101108 script : | # Required when targetType == Inline
102109 pwd
103- Invoke-WebRequest -Uri "https://www.klayout.org/downloads/klayout-microbits-4.0.zip" -OutFile klayout-microbits-4.0.zip
104- dir
105- Expand-Archive klayout-microbits-4.0.zip -DestinationPath klayout-microbits
110+ if ("$(MICROBITS_CACHED)" -ne "true") {
111+ Write-Host "Cache miss: downloading and extracting KLayout microbits..."
112+ Invoke-WebRequest -Uri "https://www.klayout.org/downloads/klayout-microbits-4.0.zip" -OutFile klayout-microbits-4.0.zip
113+ Expand-Archive klayout-microbits-4.0.zip -DestinationPath klayout-microbits
114+ } else {
115+ Write-Host "Cache hit: restored KLayout microbits from cache."
116+ }
106117 dir klayout-microbits
107118 # errorActionPreference: 'stop' # Optional. Options: stop, continue, silentlyContinue
108119 # failOnStderr: false # Optional
You can’t perform that action at this time.
0 commit comments