|
1 | 1 | name: CI |
2 | 2 | on: |
3 | | - - push |
4 | | - - pull_request |
5 | | -jobs: |
| 3 | + push: |
| 4 | + branches: [main] |
| 5 | + pull_request: |
| 6 | + branches: [main] |
6 | 7 |
|
| 8 | +jobs: |
7 | 9 | cabal: |
8 | 10 | name: ${{ matrix.os }} - GHC ${{ matrix.ghc }} |
9 | 11 | runs-on: ${{ matrix.os }} |
10 | 12 | strategy: |
11 | 13 | matrix: |
12 | 14 | os: [ubuntu-latest, macOS-latest, windows-latest] |
13 | 15 | ghc: |
14 | | - - 9.2.7 |
15 | | - - 9.4.4 |
16 | | - - 9.6.1 |
| 16 | + - 9.8 |
| 17 | + - 9.6 |
| 18 | + - 9.4 |
| 19 | + - 9.2 |
17 | 20 | fail-fast: false |
18 | 21 |
|
19 | 22 | steps: |
20 | | - - uses: actions/checkout@v2 |
| 23 | + - uses: actions/checkout@v4 |
21 | 24 |
|
22 | | - - uses: haskell/actions/setup@v2 |
23 | | - id: setup-haskell-cabal |
24 | | - name: Setup Haskell |
| 25 | + - name: Setup Haskell |
| 26 | + uses: haskell-actions/setup@v2 |
| 27 | + id: setup |
25 | 28 | with: |
26 | 29 | ghc-version: ${{ matrix.ghc }} |
27 | 30 |
|
| 31 | + - name: Configure |
| 32 | + run: | |
| 33 | + cabal configure --enable-tests --enable-benchmarks --test-show-details=direct |
| 34 | + cabal build all --dry-run |
| 35 | +
|
28 | 36 | - name: Restore cache |
29 | 37 | uses: actions/cache/restore@v3 |
| 38 | + id: cache |
30 | 39 | with: |
31 | | - key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }} |
32 | | - path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }} |
33 | | - restore-keys: ${{ runner.os }}-${{ matrix.ghc }}- |
| 40 | + path: ${{ steps.setup.outputs.cabal-store }} |
| 41 | + key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-plan-${{ hashfiles('dist-newstyle/cache/plan.json') }} |
| 42 | + restore-keys: | |
| 43 | + ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}- |
34 | 44 |
|
35 | | - - name: Build |
36 | | - run: | |
37 | | - cabal configure --enable-tests --enable-benchmarks --test-show-details=direct |
38 | | - cabal build all |
| 45 | + - name: Build dependencies |
| 46 | + run: cabal build all --dependencies-only |
39 | 47 |
|
40 | | - - name: Test |
41 | | - run: | |
42 | | - cabal test all |
| 48 | + - run: cabal build all |
| 49 | + - run: cabal test all |
| 50 | + - run: cabal haddock |
| 51 | + - run: cabal check |
| 52 | + - run: cabal sdist |
43 | 53 |
|
44 | 54 | - name: Save cache |
45 | 55 | uses: actions/cache/save@v3 |
46 | | - if: always() |
| 56 | + if: always() |
47 | 57 | with: |
48 | | - key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }} |
49 | | - path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }} |
| 58 | + key: ${{ steps.cache.outputs.cache-primary-key }} |
| 59 | + path: ${{ steps.setup.outputs.cabal-store }} |
0 commit comments