Updated ci
This commit is contained in:
parent
63760034cf
commit
f464d65052
1 changed files with 51 additions and 11 deletions
|
|
@ -1,5 +1,4 @@
|
||||||
name: Haskell CI
|
name: Haskell CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
|
|
@ -12,24 +11,65 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: ubuntu:22.04 # Use Ubuntu base and install via ghcup like your local setup
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: https://github.com/actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Haskell
|
|
||||||
run: |
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install -y haskell-platform cabal-install
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y curl build-essential libffi-dev libgmp-dev zlib1g-dev
|
||||||
|
|
||||||
|
- name: Install GHCup
|
||||||
|
run: |
|
||||||
|
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
|
||||||
|
echo "source ~/.ghcup/env" >> ~/.bashrc
|
||||||
|
|
||||||
|
- name: Install GHC and Cabal (matching local versions)
|
||||||
|
run: |
|
||||||
|
source ~/.ghcup/env
|
||||||
|
ghcup install ghc 9.10.2 --set
|
||||||
|
ghcup install cabal 3.14.2.0 --set
|
||||||
|
|
||||||
|
- name: Cache Cabal packages
|
||||||
|
uses: https://github.com/actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cabal/packages
|
||||||
|
~/.cabal/store
|
||||||
|
dist-newstyle
|
||||||
|
key: ${{ runner.os }}-ghc-9.10.2-cabal-${{ hashFiles('**/*.cabal', '**/cabal.project') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-ghc-9.10.2-cabal-
|
||||||
|
|
||||||
|
- name: Update Cabal package index
|
||||||
|
run: |
|
||||||
|
source ~/.ghcup/env
|
||||||
cabal update
|
cabal update
|
||||||
cabal build --only-dependencies
|
|
||||||
|
- name: Configure project
|
||||||
|
run: |
|
||||||
|
source ~/.ghcup/env
|
||||||
|
cabal configure --enable-tests --enable-benchmarks
|
||||||
|
|
||||||
|
- name: Build dependencies
|
||||||
|
run: |
|
||||||
|
source ~/.ghcup/env
|
||||||
|
cabal build --only-dependencies --enable-tests --enable-benchmarks
|
||||||
|
|
||||||
- name: Build project
|
- name: Build project
|
||||||
run: cabal build
|
run: |
|
||||||
|
source ~/.ghcup/env
|
||||||
|
cabal build --enable-tests --enable-benchmarks
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cabal test
|
run: |
|
||||||
|
source ~/.ghcup/env
|
||||||
|
cabal test --test-show-details=direct
|
||||||
|
|
||||||
|
- name: Run documentation build
|
||||||
|
run: |
|
||||||
|
source ~/.ghcup/env
|
||||||
|
cabal haddock
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue