@@ -68,30 +68,20 @@ jobs:
68
68
~\AppData\Roaming\stack
69
69
~\AppData\Local\Programs\stack
70
70
key : ${{ runner.os }}-${{ hashFiles('stack.yaml') }}-${{ matrix.extra-suffix }}
71
- - name : Update PATH on Windows
72
- if : startsWith(runner.os, 'Windows')
73
- run : |
74
- # On Windows, `stack upgrade` fails to overwrite the stack executable at
75
- # C:\hostedtoolcache\windows\stack\2.9.1\x64\, so add location of
76
- # upgraded Stack executable to the PATH for subsequent steps:
77
- "C:\Users\runneradmin\AppData\Roaming\local\bin" >> $env:GITHUB_PATH
78
- - name : Run tests
71
+
72
+ # Separating out Unix-like OS from Windows because of the problem of
73
+ # upgrading GitHub-supplied Stack 2.9.1 to 2.9.3 on Windows
74
+ - name : Run tests on Unix-like OS
75
+ if : startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
79
76
shell : bash
80
77
run : |
81
78
set -ex
82
79
83
- # Stack 2.9.3 is required to build Stack. In the bash shell on the
84
- # Windows runner, this may report that the Stack executable is not on
85
- # the PATH. That appears to be due to some latency somewhere.
80
+ # Stack 2.9.3 is required to build Stack.
86
81
stack upgrade
87
82
88
- # Introduce a short pause, otherwise, in the bash shell on the Windows
89
- # runner, the following `which` command does not recognise that
90
- # `stack.exe` has been copied to a directory on the PATH.
91
- sleep 1
92
-
93
- # Check location(s) of Stack executable(s)
94
- which -a stack
83
+ # Check the Stack version
84
+ stack --version
95
85
96
86
if [[ "${{ matrix.extra-suffix }}" == "alpine" ]]
97
87
then
@@ -112,9 +102,6 @@ jobs:
112
102
if [[ "${{ matrix.os }}" == "macos-latest" ]]
113
103
then
114
104
echo "Skipping ldd check on Mac"
115
- elif [[ "${{ matrix.os }}" == "windows-latest" ]]
116
- then
117
- echo "Skipping ldd check on Windows"
118
105
elif [[ "${{ matrix.extra-suffix }}" == "alpine" ]]
119
106
then
120
107
# ldd returns exit code 1 if it's static, so failure is success
@@ -124,3 +111,27 @@ jobs:
124
111
fi
125
112
126
113
./bin/stack --version
114
+
115
+ # Separating out Windows because of the problem of upgrading GitHub-supplied
116
+ # Stack 2.9.1 to 2.9.3 on Windows
117
+ - name : Run tests on Windows
118
+ if : startsWith(runner.os, 'Windows')
119
+ shell : bash
120
+ run : |
121
+ set -ex
122
+
123
+ # Stack 2.9.3 is required to build Stack. The --local-bin-path is
124
+ # required to allow Stack (effectively) to overwrite the currently
125
+ # running Stack executable. The should be fixed in later versions of
126
+ # Stack that reflect
127
+ # https://github.com/commercialhaskell/stack/pull/6023
128
+ stack --local-bin-path /c/hostedtoolcache/windows/stack/2.9.1/x64 upgrade
129
+
130
+ # Check the Stack version
131
+ stack --version
132
+
133
+ stack test ${{ matrix.stack-args }} --haddock --no-haddock-deps --ghc-options="-Werror -O0" --copy-bins --local-bin-path bin
134
+
135
+ echo "Skipping ldd check on Windows"
136
+
137
+ ./bin/stack --version
0 commit comments