Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

WIP: Simplify CI and update for 9.0 #1304

Closed
wants to merge 14 commits into from
57 changes: 25 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,39 @@ name: CI
on:
pull_request:
push:
branches: ["ghc-8.10"]
branches: ["ghc-9.0"]

jobs:
cabal:
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
cabal: ["3.2"]
ghc:
- "8.10.1"
- "8.10.2"

os: [ubuntu-latest] # TODO: add macOS/Windows
steps:
- uses: actions/checkout@v2
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/ghc-8.10'

- uses: actions/[email protected]
id: setup-haskell-cabal
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}

- name: Freeze
- name: Install GHC/Cabal
run: |
cabal freeze

- uses: actions/cache@v1
name: Cache ~/.cabal/store
mkdir -p $HOME/.ghcup/bin
curl -Lf "https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup" > $HOME/.ghcup/bin/ghcup
chmod u+x $HOME/.ghcup/bin/ghcup
export PATH="$HOME/.cabal/bin:$HOME/.ghcup/bin:$PATH"
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
echo "$HOME/.ghcup/bin" >> $GITHUB_PATH
ghcup install ghc 9.0.0.20201227
ghcup install cabal 3.4.0.0-rc4
ghcup set ghc 9.0.0.20201227
ghcup set cabal 3.4.0.0-rc4
- name: Cache
uses: actions/cache@v1
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}

- name: Build
path: ~/.cabal
key: ${{ runner.os }}
- name: Install dependencies
run: |
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
cabal build all

- name: Test
run: |
cabal test all
cabal update
cabal build all --only-dependencies --enable-tests --enable-benchmarks
- name: Build
run: cabal build all --enable-tests --enable-benchmarks
- name: Run tests
run: cabal test all
9 changes: 8 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,12 @@ packages: ./
./haddock-library
./haddock-test

with-compiler: ghc-9.0

allow-newer:
ghc-paths:Cabal,
*:base,
*:ghc-prim

-- Pinning the index-state helps to make reasonably CI deterministic
index-state: 2020-12-08T20:13:44Z
index-state: 2021-01-24T12:09:34Z
1 change: 1 addition & 0 deletions haddock-api/haddock-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ test-suite spec
, containers
, deepseq
, directory
, exceptions
, filepath
, ghc-boot
, transformers
Expand Down