|
| 1 | +name: ci |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - master |
| 6 | + - 2.7 |
| 7 | + pull_request: {} |
| 8 | + |
| 9 | +defaults: |
| 10 | + run: |
| 11 | + shell: bash |
| 12 | + |
| 13 | +jobs: |
| 14 | + build-old: |
| 15 | + runs-on: ${{ matrix.os }} |
| 16 | + strategy: |
| 17 | + fail-fast: true |
| 18 | + matrix: |
| 19 | + os: [ubuntu-latest] |
| 20 | + ghc: ['7.8.4', '7.6.3', '7.4.2'] |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v2 |
| 23 | + - uses: actions/cache@v2 |
| 24 | + name: Cache cabal stuff |
| 25 | + with: |
| 26 | + path: | |
| 27 | + ${{ steps.setup-haskell-cabal.outputs.cabal-store }} |
| 28 | + dist-newstyle |
| 29 | + key: ${{ runner.os }}-${{ matrix.ghc }} |
| 30 | + - name: Install GHC |
| 31 | + run: | |
| 32 | + sudo add-apt-repository ppa:hvr/ghc -y |
| 33 | + sudo apt-get update |
| 34 | + sudo apt-get install ghc-${{ matrix.ghc }} |
| 35 | + - name: Build |
| 36 | + run: | |
| 37 | + autoreconf -i |
| 38 | + cabal sdist -z -o . |
| 39 | + cabal get unix-*.tar.gz |
| 40 | + cd unix-*/ |
| 41 | + cabal build -w /opt/ghc/bin/ghc-${{ matrix.ghc }} all |
| 42 | + - name: Haddock |
| 43 | + run: cabal haddock -w /opt/ghc/bin/ghc-${{ matrix.ghc }} |
| 44 | + |
| 45 | + build: |
| 46 | + needs: build-old |
| 47 | + runs-on: ${{ matrix.os }} |
| 48 | + strategy: |
| 49 | + fail-fast: true |
| 50 | + matrix: |
| 51 | + os: [ubuntu-latest, macOS-latest] |
| 52 | + ghc: ['8.10', '8.8', '8.6', '8.4', '8.2', '8.0', '7.10'] |
| 53 | + steps: |
| 54 | + - uses: actions/checkout@v2 |
| 55 | + - uses: actions/setup-haskell@v1 |
| 56 | + id: setup-haskell-cabal |
| 57 | + with: |
| 58 | + ghc-version: ${{ matrix.ghc }} |
| 59 | + - uses: actions/cache@v2 |
| 60 | + name: Cache cabal stuff |
| 61 | + with: |
| 62 | + path: | |
| 63 | + ${{ steps.setup-haskell-cabal.outputs.cabal-store }} |
| 64 | + dist-newstyle |
| 65 | + key: ${{ runner.os }}-${{ matrix.ghc }} |
| 66 | + - name: Build |
| 67 | + run: | |
| 68 | + autoreconf -i |
| 69 | + cabal sdist -z -o . |
| 70 | + cabal get unix-*.tar.gz |
| 71 | + cd unix-*/ |
| 72 | + cabal build all |
| 73 | + - name: Haddock |
| 74 | + run: cabal haddock |
| 75 | + |
| 76 | + build-freebsd: |
| 77 | + needs: build |
| 78 | + # See https://github.com/vmactions/freebsd-vm#under-the-hood. |
| 79 | + runs-on: macos-latest |
| 80 | + steps: |
| 81 | + - uses: actions/checkout@v2 |
| 82 | + - name: Build |
| 83 | + id: build-freebsd |
| 84 | + |
| 85 | + with: |
| 86 | + usesh: true |
| 87 | + prepare: pkg install -y ghc hs-cabal-install git autoconf |
| 88 | + run: | |
| 89 | + autoreconf -i |
| 90 | + cabal sdist -z -o . |
| 91 | + cabal get unix-*.tar.gz |
| 92 | + cd unix-*/ |
| 93 | + cabal build all |
0 commit comments