|
30 | 30 | COMMON_FLAGS: '-j 2 -v'
|
31 | 31 |
|
32 | 32 | jobs:
|
| 33 | + windows-build: |
| 34 | + name: Windows, ghc-${{ matrix.ghc }} |
| 35 | + runs-on: "windows-latest" |
| 36 | + outputs: |
| 37 | + GHC_FOR_RELEASE: ${{ format('["{0}"]', env.GHC_FOR_RELEASE) }} |
| 38 | + strategy: |
| 39 | + matrix: |
| 40 | + ghc: ["9.6.1", "9.4.2", "9.2.3", "9.0.2"] |
| 41 | + steps: |
| 42 | + |
| 43 | + - uses: actions/checkout@v3 |
| 44 | + |
| 45 | + - uses: haskell/actions/setup@v2 |
| 46 | + id: setup-haskell |
| 47 | + with: |
| 48 | + ghc-version: ${{ matrix.ghc }} |
| 49 | + cabal-version: '3.8.1.0' # can't use 3.10, see |
| 50 | + # https://github.com/haskell/actions/issues/202#issuecomment-1465856373 |
| 51 | + # this will force us to not configure/run tests |
| 52 | + |
| 53 | + # The '+exe' constraint below is important, otherwise cabal-install |
| 54 | + # might decide to build the library but not the executable which is |
| 55 | + # what we need. |
| 56 | + - name: Install cabal-plan |
| 57 | + run: | |
| 58 | + cd $(mktemp -d) |
| 59 | + cabal install cabal-plan --allow-newer="base" --constraint='cabal-plan +exe' |
| 60 | + echo "$HOME/.cabal/bin:$HOME/.local/bin" >> $GITHUB_PATH |
| 61 | +
|
| 62 | + - name: Allow newer dependencies when built with latest GHC |
| 63 | + if: ${{ matrix.ghc }} == '9.6.1' |
| 64 | + run: | |
| 65 | + echo "allow-newer: *:base" >> cabal.project.release |
| 66 | +
|
| 67 | + - name: Validate print-config |
| 68 | + run: sh validate.sh $FLAGS -s print-config |
| 69 | + |
| 70 | + - name: Validate print-tool-versions |
| 71 | + run: sh validate.sh $FLAGS -s print-tool-versions |
| 72 | + |
| 73 | + - name: Release build |
| 74 | + run: cabal build all --project-file=cabal.project.release |
| 75 | + |
| 76 | + - name: Tar cabal head executable |
| 77 | + if: matrix.ghc == env.GHC_FOR_RELEASE |
| 78 | + run: | |
| 79 | + CABAL_EXEC=$(cabal-plan list-bin cabal-install:exe:cabal) |
| 80 | + # We have to tar the executable to preserve executable permissions |
| 81 | + # see https://github.com/actions/upload-artifact/issues/38 |
| 82 | + # |
| 83 | + # `cabal-plan` gives us a windows path but tar needs the posix one |
| 84 | + CABAL_EXEC=$(cygpath $CABAL_EXEC) |
| 85 | + tar -cvf cabal-head.tar -C $(dirname "$CABAL_EXEC") $(basename "$CABAL_EXEC") |
| 86 | + echo "CABAL_EXEC_TAR=cabal-head.tar" >> $GITHUB_ENV |
| 87 | +
|
| 88 | + # We upload the cabal executable built with the ghc used in the release for: |
| 89 | + # - Reuse it in the dogfooding job (although we could use the cached build dir) |
| 90 | + # - Make it available in the workflow to make easier testing it locally |
| 91 | + - name: Upload cabal-install executable to workflow artifacts |
| 92 | + if: matrix.ghc == env.GHC_FOR_RELEASE |
| 93 | + uses: actions/upload-artifact@v3 |
| 94 | + with: |
| 95 | + name: cabal-${{ runner.os }}-${{ matrix.ghc }} |
| 96 | + path: ${{ env.CABAL_EXEC_TAR }} |
| 97 | + |
33 | 98 | validate:
|
34 | 99 | name: Validate ${{ matrix.os }} ghc-${{ matrix.ghc }}
|
35 | 100 | runs-on: ${{ matrix.os }}
|
@@ -57,12 +122,12 @@ jobs:
|
57 | 122 | # lot of segfaults caused by ghc bugs
|
58 | 123 | - os: "windows-latest"
|
59 | 124 | ghc: "8.8.4"
|
60 |
| - # it also throws segfaults randomly |
61 |
| - - os: "windows-latest" |
62 |
| - ghc: "8.4.4" |
63 | 125 | # it often randomly does "C:\Users\RUNNER~1\AppData\Local\Temp\ghcFEDE.c: DeleteFile "\\\\?\\C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\ghcFEDE.c": permission denied (Access is denied.)"
|
64 | 126 | - os: "windows-latest"
|
65 | 127 | ghc: "8.6.5"
|
| 128 | + # it also throws segfaults randomly |
| 129 | + - os: "windows-latest" |
| 130 | + ghc: "8.4.4" |
66 | 131 |
|
67 | 132 | steps:
|
68 | 133 |
|
@@ -101,6 +166,7 @@ jobs:
|
101 | 166 | restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20231920-
|
102 | 167 |
|
103 | 168 | - name: Did we get a cache hit
|
| 169 | + if: ${{ runner.os != 'Windows' }} |
104 | 170 | continue-on-error: true
|
105 | 171 | run: echo "GHA cache hit:" ${{ steps.cache-haskell.outputs.cache-hit }}
|
106 | 172 |
|
@@ -166,7 +232,7 @@ jobs:
|
166 | 232 | run: sh validate.sh $FLAGS -s build
|
167 | 233 |
|
168 | 234 | - name: Tar cabal head executable
|
169 |
| - if: matrix.cmoewmoewli != 'false' && matrix.ghc == env.GHC_FOR_RELEASE |
| 235 | + if: matrix.cli != 'false' && matrix.ghc == env.GHC_FOR_RELEASE |
170 | 236 | run: |
|
171 | 237 | CABAL_EXEC=$(cabal-plan list-bin --builddir=dist-newstyle-validate-ghc-${{ matrix.ghc }} cabal-install:exe:cabal)
|
172 | 238 | # We have to tar the executable to preserve executable permissions
|
@@ -246,10 +312,10 @@ jobs:
|
246 | 312 | with:
|
247 | 313 | # validate.sh uses a special build dir
|
248 | 314 | path: |
|
249 |
| - ${{ steps.setup-haskell.outputs.cabal-store }} |
| 315 | + # TODO: need cabal store path; where does ghcup put it? |
250 | 316 | dist-*
|
251 |
| - key: ${{ runner.os }}-${{ matrix.ghc }}-20231920-${{ github.sha }} |
252 |
| - restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20231920- |
| 317 | + key: ${{ runner.os }}-prerelease-20231920-${{ github.sha }} |
| 318 | + restore-keys: ${{ runner.os }}-prerelease-20231920- |
253 | 319 |
|
254 | 320 | # See https://github.com/haskell/cabal/pull/8739
|
255 | 321 | - name: Sudo chmod to permit ghcup to update its cache
|
@@ -327,7 +393,8 @@ jobs:
|
327 | 393 | env:
|
328 | 394 | # `rawSystemStdInOut reports text decoding errors`
|
329 | 395 | # test does not find ghc without the full path in windows
|
330 |
| - GHCPATH: ${{ steps.setup-haskell.outputs.ghc-exe }} |
| 396 | + GHCPATH: ${{ steps.setup-haskell.outputs.ghc-exe }} # TODO: we don't |
| 397 | + # use setup-haskell here, so above variable is not set |
331 | 398 | run: sh validate.sh $FLAGS -s lib-tests
|
332 | 399 |
|
333 | 400 | - name: Validate lib-suite
|
@@ -385,7 +452,6 @@ jobs:
|
385 | 452 | - uses: actions/cache@v3
|
386 | 453 | with:
|
387 | 454 | path: |
|
388 |
| - ${{ steps.setup-haskell.outputs.cabal-store }} |
389 | 455 | dist-*
|
390 | 456 | key: ${{ runner.os }}-${{ matrix.ghc }}-20231920-${{ github.sha }}
|
391 | 457 | restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20231920-
|
@@ -421,7 +487,7 @@ jobs:
|
421 | 487 | dogfooding:
|
422 | 488 | name: Dogfooding ${{ matrix.os }} ghc-${{ matrix.ghc }}
|
423 | 489 | runs-on: ${{ matrix.os }}
|
424 |
| - needs: validate |
| 490 | + needs: [validate, windows-build] |
425 | 491 | strategy:
|
426 | 492 | matrix:
|
427 | 493 | os: ["ubuntu-20.04", "macos-latest", "windows-latest"]
|
@@ -481,7 +547,7 @@ jobs:
|
481 | 547 | name: Validate post job
|
482 | 548 | runs-on: ubuntu-20.04
|
483 | 549 | # IMPORTANT! Any job added to the workflow should be added here too
|
484 |
| - needs: [validate, validate-old-ghcs, dogfooding] |
| 550 | + needs: [validate, windows-build, validate-old-ghcs, dogfooding] |
485 | 551 |
|
486 | 552 | steps:
|
487 | 553 | - run: |
|
|
0 commit comments