Skip to content

Commit 6d81386

Browse files
committed
Corrected another issue with Windows testing.
1 parent 5904d79 commit 6d81386

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

.github/workflows/pre.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,20 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v4
2424

25-
# Clean cache directories before restoring cache
26-
- name: Clean Go Modules Directory
25+
# Clean cache directories on Linux/Mac
26+
- name: Clean Cache on Linux/Mac
27+
if: runner.os != 'Windows'
2728
run: |
28-
if [ "${{ runner.os }}" == "Windows" ]; then
29-
Remove-Item -Recurse -Force $HOME\.cache\go-build, $HOME\go\pkg\mod
30-
else
31-
rm -rf ~/.cache/go-build ~/go/pkg/mod
32-
fi
29+
rm -rf ~/.cache/go-build ~/go/pkg/mod
3330
shell: bash
3431

32+
# Clean cache directories on Windows
33+
- name: Clean Cache on Windows
34+
if: runner.os == 'Windows'
35+
run: |
36+
Remove-Item -Recurse -Force $env:USERPROFILE\.cache\go-build, $env:USERPROFILE\go\pkg\mod
37+
shell: pwsh
38+
3539
# Cache Go modules to speed up builds
3640
- name: Cache Go Modules
3741
uses: actions/cache@v4

0 commit comments

Comments
 (0)