Skip to content

Commit e77a5bc

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

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ jobs:
9696
-
9797
name: Install gotestsum
9898
uses: go-openapi/gh-actions/install/gotestsum@9c04f383fd8d769f5f49842f6e1ae9092ea25071 # v1.4.3
99+
-
100+
name: Ensure TMP is created on windows runners
101+
# On windows, some tests require testing.TempDir to reside on the same drive as the code.
102+
# TMP is used by os.TempDir() to determine the location of temporary files.
103+
if: ${{ runner.os == 'Windows' }}
104+
shell: bash
105+
run: |
106+
TMP="${{ github.workspace }}\..\tmp"
107+
mkdir -p ${TMP}
108+
echo "TMP=${TMP}" >> "${GITHUB_ENV}"
99109
-
100110
name: Run unit tests on all modules (go1.25+ with go.work) [monorepo]
101111
if: ${{ needs.lint.outputs.is-monorepo == 'true' && steps.detect-go-version.outputs.is-gotestwork-supported == 'true' }}
@@ -117,16 +127,6 @@ jobs:
117127
-coverprofile='unit.coverage.${{ matrix.os }}-${{ matrix.go }}.out'
118128
-covermode=atomic
119129
./...
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}"
130130
-
131131
name: Run unit tests on all modules (<go1.25 or no go.work) [monorepo]
132132
if: >

0 commit comments

Comments
 (0)