Skip to content

Commit

Permalink
Merge pull request phuhl#232 from d3adb5/ci/use-latest-stack
Browse files Browse the repository at this point in the history
ci: use latest stack, resolver ghc, and cache deps
  • Loading branch information
phuhl authored Jul 25, 2023
2 parents eb73406 + 2886a58 commit 3069038
Showing 1 changed file with 27 additions and 24 deletions.
51 changes: 27 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,48 @@
name: CI

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

jobs:
stack:
name: stack / ghc ${{ matrix.ghc }}
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
stack: ["2.7.3"]
ghc: ["8.10.7"]

steps:
- uses: actions/checkout@v2
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'
- uses: actions/checkout@v3

- uses: haskell/actions/setup@v1
name: Setup Haskell Stack
with:
ghc-version: ${{ matrix.ghc }}
stack-version: ${{ matrix.stack }}
enable-stack: true
- uses: actions/[email protected]
- uses: actions/cache@v3
name: Cache ~/.stack
with:
path: ~/.stack
key: ${{ runner.os }}-${{ matrix.ghc }}-stack
key: stack-global-${{ hashFiles('stack.yaml') }}
restore-keys: stack-global-

- uses: actions/cache@v3
name: Cache .stack-work
with:
path: .stack-work
key: stack-work-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}-${{ hashFiles('**/*.hs') }}
restore-keys: stack-work-

- uses: haskell/actions/setup@v2
name: Setup Haskell Stack
with:
stack-version: latest
stack-no-global: true
stack-setup-ghc: true
enable-stack: true

- name: Install non-hs dependencies
run: sudo apt-get update && sudo apt-get install libgtk-3-dev gobject-introspection libgirepository1.0-dev libwebkit2gtk-4.0-dev libgtksourceview-3.0-dev

- name: Install dependencies
run: |
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --only-dependencies
run: stack build --only-dependencies

- name: Build
run: |
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks
run: stack build

- name: Test
run: |
stack test --system-ghc
run: stack test

0 comments on commit 3069038

Please sign in to comment.