on master help sign in
Improve the new CI setup
4c0f44cMark Karpov
.github/workflows/ci.yaml+13−3
@@ -1,5 +1,12 @@
1name: CI
1name: CI
2+on:
2−on: push
3+ push:
4+ branches:
5+ - master
6+ pull_request:
7+ types:
8+ - opened
9+ - synchronize
3jobs:
10jobs:
4 build:
11 build:
5 runs-on: ubuntu-latest
12 runs-on: ubuntu-latest
@@ -15,14 +22,17 @@ jobs:
15 with:
22 with:
16 ghc-version: ${{ matrix.ghc }}
23 ghc-version: ${{ matrix.ghc }}
17 cabal-version: ${{ matrix.cabal }}
24 cabal-version: ${{ matrix.cabal }}
25+ - run: cabal v2-update
26+ - run: cabal v2-freeze $CONFIG
18 - uses: actions/cache@v2
27 - uses: actions/cache@v2
19 with:
28 with:
20 path: |
29 path: |
21 ~/.cabal/packages
30 ~/.cabal/packages
22 ~/.cabal/store
31 ~/.cabal/store
23 dist-newstyle
32 dist-newstyle
24− key: ${{ runner.os }}-${{ matrix.ghc }}
33+ key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
25− - run: cabal v2-update
34+ restore-keys: |
35+ ${{ runner.os }}-${{ matrix.ghc }}-
26 - run: cabal format && git diff --exit-code --color=always
36 - run: cabal format && git diff --exit-code --color=always
27 - run: cabal v2-build $CONFIG
37 - run: cabal v2-build $CONFIG
28 - run: cabal v2-test $CONFIG
38 - run: cabal v2-test $CONFIG