Skip to content

Commit

Permalink
Use Stack instead of Cabal for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-si committed Nov 21, 2023
1 parent efb1826 commit 5a031da
Showing 1 changed file with 22 additions and 31 deletions.
53 changes: 22 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,33 @@
name: CI

# Trigger the workflow on push or pull request, but only for the master branch
on:
pull_request:
push:
branches: [master]
branches: [master, main]

jobs:
build:
name: ghc ${{ matrix.ghc }}
runs-on: ubuntu-16.04
strategy:
matrix:
cabal: ["2.4"]
ghc:
- "8.8.3"

runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'

- uses: actions/setup-haskell@v1
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Checkout
uses: actions/checkout@v3

- uses: actions/cache@v1
name: Cache ~/.cabal/store
with:
path: ~/.cabal/store
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal
- name: Setup Stack
uses: haskell-actions/setup@v2
with:
enable-stack: true
stack-no-global: true

- name: Build
run: |
cabal v2-update
cabal v2-build --enable-tests --enable-benchmarks
- name: Cache Stack build files
uses: actions/cache@v2
with:
path: |
~/.stack
.stack-work
key: >-
${{ runner.os }}-stack-${{
hashFiles('stack.yaml.lock', 'package.yaml') }}
restore-keys: |
${{runner.os}}-stack
- name: Test
run: |
cabal v2-test --enable-tests
- name: Test
run: stack test

0 comments on commit 5a031da

Please sign in to comment.