|
| 1 | +# This GitHub Actions script was modified from from: |
| 2 | +# <https://github.com/haskell/bytestring/blob/master/.github/workflows/ci.yml> |
| 3 | +# commit/784cdd7dc492f283f41c28bfee1ab62a20c4d353 |
| 4 | +# For more guidance, see also <https://kodimensional.dev/github-actions> |
| 5 | +# |
| 6 | +# Once Haskell-CI fully supports generating GitHub Actions scripts, |
| 7 | +# we should switch over to useing that rather than maintaining this |
| 8 | +# file manually. |
| 9 | +name: ci |
| 10 | +on: |
| 11 | + push: |
| 12 | + branches: |
| 13 | + - master |
| 14 | + pull_request: {} |
| 15 | + |
| 16 | +defaults: |
| 17 | + run: |
| 18 | + shell: bash |
| 19 | + |
| 20 | +jobs: |
| 21 | + build: |
| 22 | + name: ${{ matrix.os }} / ghc ${{ matrix.ghc }} |
| 23 | + runs-on: ${{ matrix.os }} |
| 24 | + strategy: |
| 25 | + fail-fast: true |
| 26 | + matrix: |
| 27 | + os: [ubuntu-latest] |
| 28 | + # Note(2021.10.16): GitHub now has 9.0.1. |
| 29 | + ghc: ['8.0.2', '8.2.2', '8.4.4', '8.6.5', '8.8.4', '8.10.3', '9.0.1'] |
| 30 | + include: |
| 31 | + - os: windows-latest |
| 32 | + ghc: 'latest' # Lacking Win-specific bits, latest should suffice. |
| 33 | + - os: macOS-latest |
| 34 | + ghc: 'latest' # Lacking Mac-specific bits, latest should suffice. |
| 35 | + steps: |
| 36 | + |
| 37 | + - uses: haskell/actions/[email protected] |
| 38 | + id: setup-haskell-cabal |
| 39 | + with: |
| 40 | + ghc-version: ${{ matrix.ghc }} |
| 41 | + - name: Update cabal package database |
| 42 | + run: cabal update |
| 43 | + |
| 44 | + name: Cache cabal stuff |
| 45 | + with: |
| 46 | + path: | |
| 47 | + ${{ steps.setup-haskell-cabal.outputs.cabal-store }} |
| 48 | + dist-newstyle |
| 49 | + key: ${{ runner.os }}-${{ matrix.ghc }} |
| 50 | + - name: Install dependencies |
| 51 | + run: | |
| 52 | + cabal build all --only-dependencies |
| 53 | + - name: Build |
| 54 | + run: | |
| 55 | + cabal build all |
| 56 | + ## BUG: our Tasty tests aren't hooked into cabal yet... |
| 57 | + ## TODO: why does bytestring run tests via sdist stuff instead of just directly? |
| 58 | + #- name: Test |
| 59 | + # run: | |
| 60 | + # cabal sdist -z -o . |
| 61 | + # cabal get unification-fd-*.tar.gz |
| 62 | + # cd unification-fd-*/ |
| 63 | + # cp ../cabal.project . |
| 64 | + # cabal test --test-show-details=direct |
| 65 | + ## We have no benchmarks yet |
| 66 | + #- name: Bench |
| 67 | + # run: | |
| 68 | + # cd unification-fd-*/ |
| 69 | + # cabal bench --benchmark-option=-l |
| 70 | + - name: Haddock |
| 71 | + run: cabal haddock |
| 72 | + |
| 73 | + ## BUG: our Tasty tests aren't hooked into cabal yet, so no point in this yet |
| 74 | + #build-freebsd: |
| 75 | + # # This job intentionally is using macOS because at the time of |
| 76 | + # # the writing Linux and Windows environments don't have the |
| 77 | + # # necessary virtualization features. |
| 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: Test |
| 83 | + # id: build-freebsd |
| 84 | + # uses: vmactions/[email protected] |
| 85 | + # with: |
| 86 | + # usesh: true |
| 87 | + # mem: 4096 |
| 88 | + # prepare: pkg install -y ghc hs-cabal-install git |
| 89 | + # # Virtual machine does not allow to leverage cache |
| 90 | + # # and is quite slow, so only tests are run. |
| 91 | + # run: | |
| 92 | + # cabal update |
| 93 | + # cabal test --test-show-details=direct |
0 commit comments