-
Notifications
You must be signed in to change notification settings - Fork 25
78 lines (76 loc) · 2.52 KB
/
ci.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Haskell CI
on: [pull_request]
jobs:
cabal:
name: "Cabal: ${{ matrix.ghc }} on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
ghc: ['8.10', '9.0', '9.2']
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout base repo
uses: actions/[email protected]
- name: Set up Haskell
id: setup-haskell
uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: 'latest'
- name: Configure
run: cabal new-configure
- name: Freeze
run: cabal freeze
- name: Cache
uses: actions/[email protected]
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
- name: Build
run: cabal build
stack:
name: "Stack: ${{ matrix.resolver }} on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
resolver: ['lts-18.22', 'nightly-2022-01-20']
steps:
- name: Checkout base repo
uses: actions/[email protected]
- name: Set up Haskell
id: setup-haskell
uses: haskell-actions/setup@v2
with:
stack-version: 'latest'
- name: Cache Stack global package DB
uses: actions/[email protected]
with:
path: ~/.stack
key: ${{ runner.os }}-stack-global-${{ matrix.resolver }}-${{ hashFiles('**.yaml') }}
restore-keys: ${{ runner.os }}-stack-global-${{ matrix.resolver }}
- name: Cache .stack-work
uses: actions/[email protected]
with:
path: .stack-work
key: ${{ runner.os }}-stack-work-${{ matrix.resolver}}-${{ hashFiles('**.yaml') }}
restore-keys: ${{ runner.os }}-stack-work-${{ matrix.resolver }}
# https://github.com/commercialhaskell/stack/issues/5405
- name: Clear setup-exe-cache directory
if: runner.os == 'macOS'
continue-on-error: true
run: rm -r ~/.stack/setup-exe-cache
- name: Build
run: stack build --resolver=${{ matrix.resolver }}
nix:
runs-on: ubuntu-latest
steps:
- uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: actions/checkout@v2
- run: nix-build
- run: nix-build release.nix -A tarball
- run: nix-build release.nix -A sdistTest
- run: nix-build release.nix -A docs