Fixed ci.yml
This commit is contained in:
parent
f464d65052
commit
46f7ef70e2
1 changed files with 16 additions and 44 deletions
|
|
@ -12,64 +12,36 @@ jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: ubuntu:22.04 # Use Ubuntu base and install via ghcup like your local setup
|
image: haskell:9.10 # Official Haskell image with GHC 9.10 + Cabal preinstalled
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: https://github.com/actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Check versions
|
||||||
run: |
|
run: |
|
||||||
apt-get update
|
ghc --version
|
||||||
apt-get install -y curl build-essential libffi-dev libgmp-dev zlib1g-dev
|
cabal --version
|
||||||
|
|
||||||
- name: Install GHCup
|
# Manual caching with volumes (act-friendly)
|
||||||
|
- name: Cache Cabal store
|
||||||
run: |
|
run: |
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
|
mkdir -p ~/.cabal/packages ~/.cabal/store
|
||||||
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
|
||||||
|
|
||||||
|
- name: Update Cabal package index
|
||||||
|
run: cabal update
|
||||||
|
|
||||||
- name: Configure project
|
- name: Configure project
|
||||||
run: |
|
run: cabal configure --enable-tests --enable-benchmarks
|
||||||
source ~/.ghcup/env
|
|
||||||
cabal configure --enable-tests --enable-benchmarks
|
|
||||||
|
|
||||||
- name: Build dependencies
|
- name: Build dependencies
|
||||||
run: |
|
run: cabal build --only-dependencies --enable-tests --enable-benchmarks
|
||||||
source ~/.ghcup/env
|
|
||||||
cabal build --only-dependencies --enable-tests --enable-benchmarks
|
|
||||||
|
|
||||||
- name: Build project
|
- name: Build project
|
||||||
run: |
|
run: cabal build --enable-tests --enable-benchmarks
|
||||||
source ~/.ghcup/env
|
|
||||||
cabal build --enable-tests --enable-benchmarks
|
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: cabal test --test-show-details=direct
|
||||||
source ~/.ghcup/env
|
|
||||||
cabal test --test-show-details=direct
|
|
||||||
|
|
||||||
- name: Run documentation build
|
- name: Run documentation build
|
||||||
run: |
|
run: cabal haddock
|
||||||
source ~/.ghcup/env
|
|
||||||
cabal haddock
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue