|
| 1 | +name: Haskell CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master ] |
| 6 | + pull_request: |
| 7 | + branches: [ master ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + |
| 12 | + runs-on: ${{ matrix.os }} |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + os: [ubuntu-latest] |
| 17 | + ghc: ['8.0.2', '8.2.2', '8.4.4', '8.6.5', '8.8.4', '8.10.7', '9.0.2', '9.2.7', '9.4.5', '9.6.1'] |
| 18 | + cabal: ['3.8.1.0'] |
| 19 | + include: |
| 20 | + - os: macOS-latest |
| 21 | + ghc: '9.4.5' |
| 22 | + cabal: '3.8.1.0' |
| 23 | + - os: macOS-latest |
| 24 | + ghc: '9.6.1' |
| 25 | + cabal: '3.8.1.0' |
| 26 | + - os: windows-latest |
| 27 | + ghc: '9.4.5' |
| 28 | + cabal: '3.8.1.0' |
| 29 | + - os: windows-latest |
| 30 | + ghc: '9.6.1' |
| 31 | + cabal: '3.8.1.0' |
| 32 | + steps: |
| 33 | + - uses: actions/checkout@v3 |
| 34 | + |
| 35 | + - name: Install dependencies (Ubuntu) |
| 36 | + if: runner.os == 'Linux' |
| 37 | + run: | |
| 38 | + sudo apt-get -y update |
| 39 | + sudo apt-get -y install libtinfo5 libtinfo6 libncurses5 libncurses6 |
| 40 | +
|
| 41 | + - name: Install ghc/cabal |
| 42 | + run: | |
| 43 | + set -eux |
| 44 | + ghcup install ghc --set ${{ matrix.ghc }} |
| 45 | + ghcup install cabal ${{ matrix.cabal }} |
| 46 | + shell: bash |
| 47 | + |
| 48 | + - name: Build |
| 49 | + run: | |
| 50 | + set -eux |
| 51 | + [ "$(ghc --numeric-version)" = "${{ matrix.ghc }}" ] |
| 52 | + cabal update |
| 53 | + cabal build --enable-tests --enable-benchmarks |
| 54 | + cabal test |
| 55 | + cabal bench |
| 56 | + cabal haddock |
| 57 | + cabal check |
| 58 | + cabal sdist |
| 59 | + shell: bash |
| 60 | + |
| 61 | + - if: matrix.os == 'ubuntu-latest' |
| 62 | + name: make all |
| 63 | + run: | |
| 64 | + set -eux |
| 65 | + export "PATH=$HOME/.cabal/bin:$PATH" |
| 66 | + cabal install --overwrite-policy=always --install-method=copy cpphs |
| 67 | + make all |
| 68 | + git diff --exit-code |
| 69 | +
|
| 70 | + i386: |
| 71 | + runs-on: ubuntu-latest |
| 72 | + container: |
| 73 | + image: i386/ubuntu:bionic |
| 74 | + steps: |
| 75 | + - name: Install |
| 76 | + run: | |
| 77 | + apt-get update -y |
| 78 | + apt-get install -y autoconf build-essential zlib1g-dev libgmp-dev curl libncurses5 libtinfo5 libncurses5-dev libtinfo-dev |
| 79 | + curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_INSTALL_NO_STACK=1 sh |
| 80 | + - uses: actions/checkout@v1 |
| 81 | + - name: Test |
| 82 | + run: | |
| 83 | + . ~/.ghcup/env |
| 84 | + cabal update |
| 85 | + cabal test |
| 86 | + cabal bench |
| 87 | +
|
| 88 | + # We use github.com/haskell self-hosted runners for ARM testing. |
| 89 | + # If they become unavailable in future, put ['armv7', 'aarch64'] |
| 90 | + # back to emulation jobs above. |
| 91 | + arm: |
| 92 | + runs-on: [self-hosted, Linux, ARM64] |
| 93 | + strategy: |
| 94 | + fail-fast: true |
| 95 | + matrix: |
| 96 | + arch: [arm32v7, arm64v8] |
| 97 | + steps: |
| 98 | + - uses: docker://hasufell/arm64v8-ubuntu-haskell:focal |
| 99 | + name: Cleanup |
| 100 | + with: |
| 101 | + args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +" |
| 102 | + |
| 103 | + - name: Checkout code |
| 104 | + uses: actions/checkout@v3 |
| 105 | + |
| 106 | + - if: matrix.arch == 'arm32v7' |
| 107 | + uses: docker://hasufell/arm32v7-ubuntu-haskell:focal |
| 108 | + name: Run build (arm32v7 linux) |
| 109 | + with: |
| 110 | + args: sh -c "cabal update && ghcup install ghc --isolate=/usr --force 9.2.2 && cabal test -w ghc-9.2.2 && cabal bench -w ghc-9.2.2" |
| 111 | + |
| 112 | + - if: matrix.arch == 'arm64v8' |
| 113 | + uses: docker://hasufell/arm64v8-ubuntu-haskell:focal |
| 114 | + name: Run build (arm64v8 linux) |
| 115 | + with: |
| 116 | + args: sh -c "cabal update && ghcup install ghc --isolate=/usr --force 9.2.2 && cabal test -w ghc-9.2.2 && cabal bench -w ghc-9.2.2" |
| 117 | + |
| 118 | + darwin_arm: |
| 119 | + runs-on: ${{ matrix.os }} |
| 120 | + env: |
| 121 | + MACOSX_DEPLOYMENT_TARGET: 10.13 |
| 122 | + strategy: |
| 123 | + fail-fast: false |
| 124 | + matrix: |
| 125 | + include: |
| 126 | + - os: [self-hosted, macOS, ARM64] |
| 127 | + ghc: 8.10.7 |
| 128 | + - os: [self-hosted, macOS, ARM64] |
| 129 | + ghc: 9.2.6 |
| 130 | + - os: [self-hosted, macOS, ARM64] |
| 131 | + ghc: 9.4.4 |
| 132 | + steps: |
| 133 | + - name: Checkout code |
| 134 | + uses: actions/checkout@v3 |
| 135 | + |
| 136 | + - name: Run build |
| 137 | + run: | |
| 138 | + bash .github/scripts/brew.sh git coreutils llvm@11 autoconf automake |
| 139 | + export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$HOME/.brew/opt/llvm@11/bin:$PATH" |
| 140 | + export CC="$HOME/.brew/opt/llvm@11/bin/clang" |
| 141 | + export CXX="$HOME/.brew/opt/llvm@11/bin/clang++" |
| 142 | + export LD=ld |
| 143 | + export AR="$HOME/.brew/opt/llvm@11/bin/llvm-ar" |
| 144 | + export RANLIB="$HOME/.brew/opt/llvm@11/bin/llvm-ranlib" |
| 145 | + . .github/scripts/env.sh |
| 146 | + curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_INSTALL_NO_STACK=1 BOOTSTRAP_HASKELL_GHC_VERSION=${{ matrix.ghc }} BOOTSTRAP_HASKELL_ADJUST_BASHRC=yes sh |
| 147 | + cabal test |
| 148 | + cabal bench |
| 149 | + env: |
| 150 | + HOMEBREW_CHANGE_ARCH_TO_ARM: 1 |
0 commit comments