-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (57 loc) · 1.7 KB
/
Cabal-Linux.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: "Hackage, Cabal, Linux"
on:
pull_request:
push:
branches:
- master
schedule:
- cron: "45 02 * * *"
env:
cabalConfig: --enable-tests --enable-benchmarks --disable-optimization --enable-deterministic
jobs:
build10:
name: "GHC"
runs-on: ubuntu-latest
# Template to build matrix of builds for subprojects in monorepo
strategy:
matrix:
packageRoots: [ ./ ]
ghc: [ "8.10", "8.4" ]
defaults:
run:
working-directory: ${{ matrix.packageRoots }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: "Haskell env setup"
id: HaskEnvSetup
uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
- uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
- name: "Repository update"
run: cabal v2-update
# NOTE: Freeze is for the caching
- name: "Configuration freeze"
run: cabal v2-freeze $cabalConfig
- name: "Configuring GitHub cache"
uses: actions/cache@v2
with:
path: |
${{ steps.HaskEnvSetup.outputs.cabal-store }}
dist-newstyle
key: ${{ runner.os }}-Cabal-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
restore-keys: ${{ runner.os }}-Cabal-${{ matrix.ghc }}-
- name: "Build"
run: cabal v2-build $cabalConfig
- name: "Tests"
run: cabal v2-test $cabalConfig
- name: "Haddock"
if: ${{ matrix.ghc == '8.10' }}
run: cabal v2-haddock $cabalConfig
- name: "Source distribution file"
if: ${{ matrix.ghc == '8.10' }}
run: cabal v2-sdist