@@ -144,15 +144,13 @@ jobs:
144144 run : |
145145 bazel build --config=parse_headers --remote_cache=https://bazel:${{ secrets.BAZEL_CACHE_KEY }}@bazel-remote-cache.devprod.cloudflare.dev --config=ci ${{ inputs.extra_bazel_args }} //src/workerd/util
146146 - name : Upload test logs
147- if : inputs.upload_test_logs
147+ if : always() && inputs.upload_test_logs
148148 uses : actions/upload-artifact@v4
149149 with :
150150 name : test-logs-${{ inputs.os_name }}-${{ inputs.arch_name }}${{ inputs.suffix }}.zip
151151 path : bazel-testlogs/**/test.xml
152152 - name : Report disk usage (in MB)
153- # This step takes a few seconds on Mac and Linux but takes 16 minutes on Windows for
154- # some reason. It doesn't seem important enough to wait for 16 minutes on every build.
155- if : runner.os != 'Windows'
153+ if : always() && runner.os != 'Windows'
156154 shell : bash
157155 run : |
158156 BAZEL_OUTPUT_BASE=$(bazel info output_base)
@@ -163,6 +161,26 @@ jobs:
163161 du -ms -t 1 $BAZEL_OUTPUT_BASE
164162 echo "Workspace usage statistics"
165163 du -ms -t 1 $GITHUB_WORKSPACE
164+ - name : Report disk usage (in MB)
165+ if : always() && runner.os == 'Windows'
166+ shell : pwsh
167+ run : |
168+ function Get-SizeMB($path) {
169+ if (Test-Path $path) {
170+ $size = (Get-ChildItem -Path $path -Recurse -Force -ErrorAction SilentlyContinue |
171+ Measure-Object -Property Length -Sum -ErrorAction SilentlyContinue).Sum
172+ [math]::Round($size / 1MB)
173+ } else { 0 }
174+ }
175+ $outputBase = bazel info output_base 2>$null
176+ $repoCache = bazel info repository_cache 2>$null
177+ echo "Bazel cache usage statistics"
178+ echo "$(Get-SizeMB $env:USERPROFILE\bazel-disk-cache)`t$env:USERPROFILE\bazel-disk-cache"
179+ echo "$(Get-SizeMB $repoCache)`t$repoCache"
180+ echo "Bazel output usage statistics"
181+ echo "$(Get-SizeMB $outputBase)`t$outputBase"
182+ echo "Workspace usage statistics"
183+ echo "$(Get-SizeMB $env:GITHUB_WORKSPACE)`t$env:GITHUB_WORKSPACE"
166184
167185 - name : Upload binary
168186 if : inputs.upload_binary
@@ -172,7 +190,7 @@ jobs:
172190 path : bazel-bin/src/workerd/server/workerd${{ runner.os == 'Windows' && '.exe' || '' }}
173191 if-no-files-found : error
174192 - name : Upload build statistics
175- if : inputs.run_tests
193+ if : always() && inputs.run_tests
176194 uses : actions/upload-artifact@v4
177195 with :
178196 name : ${{ inputs.os_name }}${{ inputs.arch_name }}${{ inputs.suffix }}-bazel-profile
@@ -196,5 +214,6 @@ jobs:
196214 fi
197215
198216 - name : Bazel shutdown
217+ if : always()
199218 # Check that there are no .bazelrc issues that prevent shutdown.
200219 run : bazel shutdown
0 commit comments