-
-
Notifications
You must be signed in to change notification settings - Fork 226
113 lines (92 loc) · 3.19 KB
/
build.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: build
# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency.
concurrency:
group: ${{ github.head_ref }}-${{ github.workflow }}
on:
pull_request:
branches: main
types:
- opened
- synchronize
push:
branches: main
paths-ignore:
- "configs/**"
- "scripts/**"
- ".envrc"
- ".gitignore"
- "LICENSE"
- "**.md"
jobs:
amazonka-gen:
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
extra-substituters = https://cache.iog.io
experimental-features = nix-command flakes
- uses: cachix/cachix-action@v12
with:
name: amazonka
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- uses: actions/checkout@v3
- run: nix build
amazonka-lib:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
ghc: ghc96 # Latest mainline GHC
- os: ubuntu-latest
ghc: ghc94 # Most industrially-relevant GHC
- os: ubuntu-latest
ghc: ghc90 # Catch errors due to simplified subsumption
- os: macos-latest
ghc: ghc94
runs-on: ${{ matrix.os }}
steps:
- if: ${{ matrix.os == 'ubuntu-latest' }}
run: |-
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt &
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
extra-substituters = https://cache.iog.io
experimental-features = nix-command flakes
- uses: cachix/cachix-action@v12
with:
name: amazonka
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- uses: actions/checkout@v3
- name: cabal update && cabal freeze
run: |
nix develop --print-build-logs --command \
bash -c 'cabal update && cabal freeze' '.#${{matrix.ghc}}'
- uses: actions/cache@v3
with:
key: v1-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
restore-keys: |
v1-${{ runner.os }}-${{ matrix.ghc }}-
path: |
~/.cabal/store
dist-newstyle
- name: cabal build core
run: |
nix develop --print-build-logs --command \
bash -c 'cabal build amazonka-core amazonka' '.#${{matrix.ghc}}'
- name: cabal build s3-encryption
run: |
nix develop --print-build-logs --command \
bash -c 'cabal build amazonka-s3-encryption' '.#${{matrix.ghc}}'
- name: cabal build all
run: |
nix develop --print-build-logs --command \
bash -c 'cabal test all' '.#${{matrix.ghc}}'