88 schedule :
99 - cron : " 45 02 * * *"
1010
11+ env :
12+ cabalConfig : --enable-tests --enable-benchmarks --disable-optimization --enable-deterministic
1113
1214jobs :
1315
@@ -18,25 +20,40 @@ jobs:
1820 matrix :
1921 ghc : [ "8.10", "8.4" ]
2022 steps :
21- - uses : actions/checkout@v2
23+ - name : " Git checkout"
24+ uses : actions/checkout@v2
2225 with :
2326 submodules : recursive
24- - name : " Cache of ~/.cabal/packages, ~/.cabal/store and dist-newstyle"
25- uses : actions/cache@v2
26- with :
27- path : |
28- ~/.cabal/packages
29- ~/.cabal/store
30- dist-newstyle
31- key : ${{ runner.os }}-Cabal-${{ matrix.ghc }}
32- - uses : haskell/actions/setup@v1
27+ - name : " Haskell env setup"
28+ id : HaskEnvSetup
29+ uses : haskell/actions/setup@v1
3330 with :
3431 ghc-version : ${{ matrix.ghc }}
3532 - name : " Install additional system packages"
3633 run : sudo apt install libsodium-dev
3734 # 2020-08-01: NOTE: Nix instantiate still needed for HNix tests
3835 - name : " Install Nix"
3936 uses : cachix/install-nix-action@v12
40- - run : cabal v2-configure --disable-optimization --enable-tests --enable-deterministic
41- - run : cabal v2-build
42- - run : cabal v2-test
37+ - name : " Repository update"
38+ run : cabal v2-update
39+ # NOTE: Freeze is for the caching
40+ - name : " Configuration freeze"
41+ run : cabal v2-freeze $cabalConfig
42+ - name : " Configuring GitHub cache"
43+ uses : actions/cache@v2
44+ with :
45+ path : |
46+ ${{ steps.HaskEnvSetup.outputs.cabal-store }}
47+ dist-newstyle
48+ key : ${{ runner.os }}-Cabal-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
49+ restore-keys : ${{ runner.os }}-Cabal-${{ matrix.ghc }}-
50+ - name : " Build"
51+ run : cabal v2-build $cabalConfig
52+ - name : " Tests"
53+ run : cabal v2-test $cabalConfig
54+ - name : " Haddock"
55+ if : ${{ matrix.ghc == '8.10' }}
56+ run : cabal v2-haddock $cabalConfig
57+ - name : " Source distribution file"
58+ if : ${{ matrix.ghc == '8.10' }}
59+ run : cabal v2-sdist
0 commit comments