Skip to content

Commit dc1683b

Browse files
committed
Dont use ghc-x.y.z and reorganize flags
1 parent 4f4d47e commit dc1683b

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

.github/workflows/validate.yml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ env:
2727
# Ideally the three ghcs should be the used for the release
2828
GHC_FOR_SOLVER_BENCHMARKS: '8.10.7'
2929
GHC_FOR_COMPLETE_HACKAGE_TESTS: '8.10.7'
30+
COMMON_FLAGS: '-j 2 -v'
3031

3132
jobs:
3233
validate:
@@ -91,7 +92,7 @@ jobs:
9192
9293
- name: Set validate inputs
9394
run: |
94-
FLAGS=""
95+
FLAGS="${{ env.COMMON_FLAGS }}"
9596
if [[ "${{ matrix.cli }}" == "false" ]]; then
9697
FLAGS="$FLAGS --lib-only"
9798
fi
@@ -104,13 +105,13 @@ jobs:
104105
echo "FLAGS=$FLAGS" >> $GITHUB_ENV
105106
106107
- name: Validate print-config
107-
run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v $FLAGS -s print-config
108+
run: sh validate.sh $FLAGS -s print-config
108109

109110
- name: Validate print-tool-versions
110-
run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v $FLAGS -s print-tool-versions
111+
run: sh validate.sh $FLAGS -s print-tool-versions
111112

112113
- name: Validate build
113-
run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v $FLAGS -s build
114+
run: sh validate.sh $FLAGS -s build
114115

115116
- name: Tar cabal head executable
116117
if: matrix.cli != 'false' && matrix.ghc == env.GHC_FOR_RELEASE
@@ -139,21 +140,18 @@ jobs:
139140
# `rawSystemStdInOut reports text decoding errors`
140141
# test does not find ghc without the full path in windows
141142
GHCPATH: ${{ steps.setup-haskell.outputs.ghc-exe }}
142-
run: sh validate.sh -j 2 -w $GHCPATH -v $FLAGS -s lib-tests
143+
run: sh validate.sh $FLAGS -s lib-tests
143144

144145
- name: Validate lib-suite
145-
run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v $FLAGS -s lib-suite
146+
run: sh validate.sh $FLAGS -s lib-suite
146147

147148
- name: Validate cli-tests
148149
if: matrix.cli != 'false'
149-
run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v $FLAGS -s cli-tests
150+
run: sh validate.sh $FLAGS -s cli-tests
150151

151152
- name: Validate cli-suite
152153
if: matrix.cli != 'false'
153-
# We have to use `-w ghc` intead `-w ghc-${{ matrix.ghc }}` here to
154-
# workaround the max path limit in windows for ghc <= 8.6.5
155-
# See https://github.com/haskell/cabal/issues/6271#issuecomment-1065102255
156-
run: sh validate.sh -j 2 -w ghc -v $FLAGS -s cli-suite
154+
run: sh validate.sh $FLAGS -s cli-suite
157155

158156
validate-old-ghcs:
159157
name: Validate old ghcs ${{ matrix.extra-ghc }}
@@ -216,13 +214,12 @@ jobs:
216214
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
217215
218216
- name: Validate build
219-
run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s build
217+
run: sh validate.sh ${{ env.COMMON_FLAGS }} -s build
220218

221219
- name: "Validate lib-suite-extras --extra-hc ghc-${{ matrix.extra-ghc }}"
222220
env:
223-
FLAGS: "--lib-only -s lib-suite-extras"
224221
EXTRA_GHC: "/opt/ghc/${{ matrix.extra-ghc }}/bin/ghc-${{ matrix.extra-ghc }}"
225-
run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.FLAGS }} --extra-hc ${{ env.EXTRA_GHC }}
222+
run: sh validate.sh ${{ env.COMMON_FLAGS }} --lib-only -s lib-suite-extras --extra-hc ${{ env.EXTRA_GHC }}
226223

227224
# The previous jobs use a released version of cabal to build cabal HEAD itself
228225
# This one uses the cabal HEAD generated executable in the previous step
@@ -258,12 +255,12 @@ jobs:
258255
run: tar -xf ./cabal-head/cabal-head.tar -C ./cabal-head
259256

260257
- name: print-config using cabal HEAD
261-
run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} --with-cabal ./cabal-head/cabal -v -s print-config
258+
run: sh validate.sh ${{ env.COMMON_FLAGS }} --with-cabal ./cabal-head/cabal -s print-config
262259

263260
# We dont use cache to force a build with a fresh store dir and build dir
264261
# This way we check cabal can build all its dependencies
265262
- name: Build using cabal HEAD
266-
run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} --with-cabal ./cabal-head/cabal -v -s build
263+
run: sh validate.sh ${{ env.COMMON_FLAGS }} --with-cabal ./cabal-head/cabal -s build
267264

268265
# We use this job as a resume of the workflow
269266
# It will fail if any of the previous jobs does it

0 commit comments

Comments
 (0)