forked from phuhl/linux_notification_center
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request phuhl#232 from d3adb5/ci/use-latest-stack
ci: use latest stack, resolver ghc, and cache deps
- Loading branch information
Showing
1 changed file
with
27 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |