|
| 1 | +name: Build and Test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ "master" ] |
| 6 | + pull_request: |
| 7 | + branches: [ "master" ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + cabal: |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + ghc: ['8.10.7','9.0.2','9.2.8','9.4.8','9.6.7','9.8.4','9.10.2','9.12.2'] |
| 14 | + runs-on: [windows-latest, macos-latest, ubuntu-latest] |
| 15 | + exclude: |
| 16 | + - runs-on: macos-latest # requires llvm@13 but it's disabled in homebrew |
| 17 | + ghc: '8.10.7' |
| 18 | + - runs-on: macos-latest # requires llvm@13 but it's disabled in homebrew |
| 19 | + ghc: '9.0.2' |
| 20 | + fail-fast: false |
| 21 | + name: Cabal - ${{ matrix.runs-on }} GHC ${{ matrix.ghc }} |
| 22 | + runs-on: ${{ matrix.runs-on }} |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v5 |
| 25 | + - uses: haskell-actions/setup@v2 |
| 26 | + with: |
| 27 | + ghc-version: ${{ matrix.ghc }} |
| 28 | + |
| 29 | + - name: Cache dependencies |
| 30 | + uses: actions/cache@v4 |
| 31 | + with: |
| 32 | + path: | |
| 33 | + ~/.cabal |
| 34 | + dist-newstyle |
| 35 | + key: ${{ matrix.runs-on }}-cabal-${{ matrix.ghc }}-${{ hashFiles('streaming-commons.cabal') }} |
| 36 | + restore-keys: | |
| 37 | + ${{ matrix.runs-on }}-cabal-${{ matrix.ghc }} |
| 38 | + ${{ matrix.runs-on }}-cabal- |
| 39 | +
|
| 40 | + - name: Update Cabal package list |
| 41 | + run: cabal v2-update --with-compiler=ghc-${{ matrix.ghc }} |
| 42 | + |
| 43 | + - name: Build project |
| 44 | + run: cabal v2-build --with-compiler=ghc-${{ matrix.ghc }} |
| 45 | + |
| 46 | + - name: Run tests |
| 47 | + run: cabal v2-test --with-compiler=ghc-${{ matrix.ghc }} |
| 48 | + |
| 49 | + stack: |
| 50 | + strategy: |
| 51 | + matrix: |
| 52 | + resolver: ['lts-18','lts-19','lts-20','lts-21','lts-22', 'lts-23', 'lts-24','nightly'] |
| 53 | + runs-on: [windows-latest, macos-latest, ubuntu-latest] |
| 54 | + exclude: |
| 55 | + - runs-on: macos-latest # requires llvm@13 but it's disabled in homebrew |
| 56 | + resolver: 'lts-18' |
| 57 | + - runs-on: macos-latest # requires llvm@13 but it's disabled in homebrew |
| 58 | + resolver: 'lts-19' |
| 59 | + fail-fast: false |
| 60 | + name: Stack - ${{ matrix.runs-on }} Resolver ${{ matrix.resolver }} |
| 61 | + runs-on: ${{ matrix.runs-on }} |
| 62 | + steps: |
| 63 | + - uses: actions/checkout@v5 |
| 64 | + - uses: haskell-actions/setup@v2 |
| 65 | + with: |
| 66 | + enable-stack: true |
| 67 | + |
| 68 | + - name: Cache dependencies |
| 69 | + uses: actions/cache@v4 |
| 70 | + with: |
| 71 | + path: ~/.stack |
| 72 | + key: ${{ matrix.runs-on }}-stack-${{ matrix.resolver }}-${{ hashFiles('stack.yaml') }} |
| 73 | + restore-keys: | |
| 74 | + ${{ matrix.runs-on }}-stack-${{ matrix.resolver }}- |
| 75 | + ${{ matrix.runs-on }}-stack- |
| 76 | +
|
| 77 | + - name: Install dependencies for resolver ${{ matrix.resolver }} |
| 78 | + run: stack setup --resolver ${{ matrix.resolver }} |
| 79 | + |
| 80 | + - name: Build the project with resolver ${{ matrix.resolver }} |
| 81 | + run: stack build --resolver ${{ matrix.resolver }} |
| 82 | + |
| 83 | + - name: Run spec tests with resolver ${{ matrix.resolver }} |
| 84 | + run: stack test --resolver ${{ matrix.resolver }} |
0 commit comments