Skip to content

Commit 0bada73

Browse files
committed
ci(windows): surface sccache server write diagnostics
Signed-off-by: Piotr Mlocek <[email protected]>
1 parent 61016c7 commit 0bada73

1 file changed

Lines changed: 27 additions & 3 deletions

File tree

‎.github/workflows/windows-msvc.yml‎

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ jobs:
6969
experimental: true
7070
- name: Configure GHA sccache backend
7171
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
72+
env:
73+
SCCACHE_ERROR_LOG: ${{ runner.temp }}/openshell-sccache-errors.log
7274
- name: Isolate Rust toolchains
7375
# rust-cache hashes every installed toolchain, including unused runner defaults.
7476
run: '"RUSTUP_HOME=$env:RUNNER_TEMP/openshell-rustup" >> $env:GITHUB_ENV'
@@ -96,7 +98,13 @@ jobs:
9698
run: mise run --skip-tools windows:test:${{ matrix.arch }}
9799
- name: sccache stats
98100
if: always()
99-
run: sccache --show-stats
101+
run: |
102+
sccache --show-stats
103+
$cacheErrorLog = Join-Path $env:RUNNER_TEMP 'openshell-sccache-errors.log'
104+
if (Test-Path -LiteralPath $cacheErrorLog) {
105+
Get-Content -LiteralPath $cacheErrorLog -Tail 20 |
106+
ForEach-Object { $_ -replace '(https?://[^\s?]+)\?\S+', '$1?[redacted]' }
107+
}
100108
101109
cache-seed:
102110
name: Seed cache (${{ matrix.arch }})
@@ -129,6 +137,8 @@ jobs:
129137
experimental: true
130138
- name: Configure GHA sccache backend
131139
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
140+
env:
141+
SCCACHE_ERROR_LOG: ${{ runner.temp }}/openshell-sccache-errors.log
132142
- name: Isolate Rust toolchains
133143
run: '"RUSTUP_HOME=$env:RUNNER_TEMP/openshell-rustup" >> $env:GITHUB_ENV'
134144
- uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30 # stable
@@ -155,7 +165,13 @@ jobs:
155165
run: mise run --skip-tools windows:test:${{ matrix.arch }}
156166
- name: sccache stats
157167
if: always()
158-
run: sccache --show-stats
168+
run: |
169+
sccache --show-stats
170+
$cacheErrorLog = Join-Path $env:RUNNER_TEMP 'openshell-sccache-errors.log'
171+
if (Test-Path -LiteralPath $cacheErrorLog) {
172+
Get-Content -LiteralPath $cacheErrorLog -Tail 20 |
173+
ForEach-Object { $_ -replace '(https?://[^\s?]+)\?\S+', '$1?[redacted]' }
174+
}
159175
160176
build:
161177
name: Build binaries (${{ matrix.arch }})
@@ -185,6 +201,8 @@ jobs:
185201
experimental: true
186202
- name: Configure GHA sccache backend
187203
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
204+
env:
205+
SCCACHE_ERROR_LOG: ${{ runner.temp }}/openshell-sccache-errors.log
188206
- name: Isolate Rust toolchains
189207
run: '"RUSTUP_HOME=$env:RUNNER_TEMP/openshell-rustup" >> $env:GITHUB_ENV'
190208
- uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30 # stable
@@ -204,4 +222,10 @@ jobs:
204222
run: mise run --skip-tools windows:build:${{ matrix.arch }}
205223
- name: sccache stats
206224
if: always()
207-
run: sccache --show-stats
225+
run: |
226+
sccache --show-stats
227+
$cacheErrorLog = Join-Path $env:RUNNER_TEMP 'openshell-sccache-errors.log'
228+
if (Test-Path -LiteralPath $cacheErrorLog) {
229+
Get-Content -LiteralPath $cacheErrorLog -Tail 20 |
230+
ForEach-Object { $_ -replace '(https?://[^\s?]+)\?\S+', '$1?[redacted]' }
231+
}

0 commit comments

Comments
 (0)