|
7 | 7 | branches: ["main"]
|
8 | 8 |
|
9 | 9 | jobs:
|
10 |
| - native: |
11 |
| - name: "Native: GHC ${{ matrix.ghc }} on ${{ matrix.os }}" |
| 10 | + generate-matrix: |
| 11 | + name: "Generate matrix from cabal" |
| 12 | + outputs: |
| 13 | + matrix: ${{ steps.set-matrix.outputs.matrix }} |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - name: Extract the tested GHC versions |
| 17 | + id: set-matrix |
| 18 | + uses: kleidukos/get-tested@v0.1.7.0 |
| 19 | + with: |
| 20 | + cabal-file: plutus-integer-bytestring.cabal |
| 21 | + ubuntu-version: "latest" |
| 22 | + macos-version: "latest" |
| 23 | + windows-version: "latest" |
| 24 | + version: 0.1.7.0 |
| 25 | + tests: |
| 26 | + name: ${{ matrix.ghc }} on ${{ matrix.os }} |
| 27 | + needs: generate-matrix |
12 | 28 | runs-on: ${{ matrix.os }}
|
13 | 29 | strategy:
|
14 |
| - fail-fast: false |
15 |
| - matrix: |
16 |
| - os: [ubuntu-latest, macos-latest, windows-latest] |
17 |
| - ghc: ['8.10', '9.2', '9.6'] |
| 30 | + matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }} |
18 | 31 | steps:
|
19 | 32 | - name: Checkout base repo
|
20 | 33 | uses: actions/checkout@v4
|
21 |
| - - name: Set up Haskell |
22 |
| - id: setup |
| 34 | + - name: Setup Haskell |
| 35 | + id: haskell-setup |
23 | 36 | uses: haskell-actions/setup@v2
|
24 | 37 | with:
|
25 | 38 | ghc-version: ${{ matrix.ghc }}
|
26 |
| - cabal-version: 'latest' |
| 39 | + cabal-version: "latest" |
27 | 40 | - name: Configure
|
28 | 41 | run: |
|
29 | 42 | cabal configure --enable-tests
|
30 |
| - cabal build --dry-run |
31 |
| - - name: Restore cached dependencies |
32 |
| - uses: actions/cache/restore@v3 |
33 |
| - id: cache |
34 |
| - env: |
35 |
| - key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }} |
36 |
| - with: |
37 |
| - path: ${{ steps.setup.outputs.cabal-store }} |
38 |
| - key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }} |
39 |
| - restore-keys: ${{ env.key }}- |
40 |
| - - name: Install dependencies |
41 |
| - if: steps.cache.outputs.cache-hit != 'true' |
42 |
| - run: cabal build all --only-dependencies |
43 |
| - - name: Save cached dependencies |
44 |
| - uses: actions/cache/save@v3 |
45 |
| - if: steps.cache.outputs.cache-hit != 'true' |
| 43 | + cabal freeze |
| 44 | + - name: Cache |
| 45 | + uses: actions/cache@v4.0.0 |
46 | 46 | with:
|
47 |
| - path: ${{ steps.setup.outputs.cabal-store }} |
48 |
| - key: ${{ steps.cache.outputs.cache-primary-key }} |
| 47 | + path: ${{ steps.haskell-setup.outputs.cabal-store }} |
| 48 | + key: ${{ runner.os }}-ghc-${{ matrix.ghc }}-cabal-${{ hashFiles('**/plan.json') }} |
| 49 | + restore-keys: ${{ runner.os }}-ghc-${{ matrix.ghc }}- |
49 | 50 | - name: Build
|
50 | 51 | run: cabal build
|
51 |
| - - name: Test |
| 52 | + - name: Run tests |
52 | 53 | run: cabal test
|
| 54 | + |
0 commit comments