Skip to content

Commit 831dfd7

Browse files
committed
fix: (go test) forcing TMP on windows to reside on the same drive
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
1 parent 8da6e66 commit 831dfd7

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

.github/workflows/go-test-monorepo.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,16 @@ jobs:
117117
-coverprofile='unit.coverage.${{ matrix.os }}-${{ matrix.go }}.out'
118118
-covermode=atomic
119119
./...
120+
-
121+
name: Ensure TMP is created on windows runners
122+
# On windows, some tests require testing.TempDir to reside on the same drive as the code.
123+
# TMP is used by os.TempDir() to determine the location of temporary files.
124+
if: ${{ runner.os == 'Windows' }}
125+
shell: bash
126+
run: |
127+
TMP="${{ github.workspace }}\..\tmp"
128+
mkdir -p ${TMP}
129+
echo "TMP=${TMP}" >> "${GITHUB_ENV}"
120130
-
121131
name: Run unit tests on all modules (<go1.25 or no go.work) [monorepo]
122132
if: >

.github/workflows/go-test.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ jobs:
5454
-
5555
name: Install gotestsum
5656
uses: go-openapi/gh-actions/install/gotestsum@9c04f383fd8d769f5f49842f6e1ae9092ea25071 # v1.4.3
57+
-
58+
name: Ensure TMP is created on windows runners
59+
# On windows, some tests require testing.TempDir to reside on the same drive as the code.
60+
# TMP is used by os.TempDir() to determine the location of temporary files.
61+
if: ${{ runner.os == 'Windows' }}
62+
shell: bash
63+
run: |
64+
TMP="${{ github.workspace }}\..\tmp"
65+
mkdir -p ${TMP}
66+
echo "TMP=${TMP}" >> "${GITHUB_ENV}"
5767
-
5868
name: Run unit tests
5969
run: >

0 commit comments

Comments
 (0)