-
Notifications
You must be signed in to change notification settings - Fork 211
/
pipeline.yml
220 lines (190 loc) · 6.19 KB
/
pipeline.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
env:
LC_ALL: "en_US.UTF-8"
NIX_PATH: "channel:nixos-21.11"
# Per-host variables - shared across containers on host
CACHE_DIR: "/cache/cardano-wallet"
macos: "x86_64-darwin"
linux: "x86_64-linux"
steps:
- label: 'Merge from staging only'
if: 'build.branch == "staging"'
command: './.buildkite/check-bors.sh'
agents:
system: ${linux}
- wait: ~
if: 'build.branch == "staging"'
- label: 'Check nix (linux)'
# Check whether regenerate.sh was applied when it had to be applied.
key: linux-nix
commands:
- './nix/regenerate.sh'
agents:
system: ${linux}
env:
TMPDIR: "/cache"
- label: 'Build bench and run unit tests (linux)'
depends_on: linux-nix
command:
- 'nix build .#ci.tests.all'
- 'nix build .#ci.benchmarks.all'
- 'nix build -L .#ci.${linux}.tests.run.unit'
agents:
system: ${linux}
env:
TMPDIR: "/cache"
- label: 'Check Cabal Configure'
depends_on: linux-nix
command: 'nix develop --command scripts/buildkite/check-haskell-nix-cabal.sh'
agents:
system: ${linux}
env:
TMPDIR: "/cache"
- label: 'Check Stylish Haskell'
depends_on: linux-nix
command: 'nix develop --command .buildkite/check-stylish.sh'
agents:
system: ${linux}
env:
TMPDIR: "/cache"
- label: 'Check HLint'
depends_on: linux-nix
command: 'nix develop --command bash -c "echo +++ HLint ; hlint lib"'
agents:
system: ${linux}
env:
TMPDIR: "/cache"
- label: 'Validate OpenAPI Specification'
depends_on: linux-nix
command: 'nix develop --command bash -c "echo +++ openapi-spec-validator ; openapi-spec-validator --schema 3.0.0 specifications/api/swagger.yaml"'
agents:
system: ${linux}
env:
TMPDIR: "/cache"
- label: 'Build Docker Image'
depends_on: linux-nix
command:
- "mkdir -p config && echo '{ outputs = _: { dockerHubRepoName = \"inputoutput/cardano-wallet\"; }; }' > config/flake.nix"
- "nix build .#pushDockerImage --override-input hostNixpkgs \"path:$(nix eval --impure -I $NIX_PATH --expr '(import <nixpkgs> {}).path')\" --override-input customConfig path:./config -o docker-build-push"
- "./docker-build-push"
agents:
system: ${linux}
env:
TMPDIR: "/cache"
soft_fail:
- exit_status: '*'
- label: 'Print TODO list'
depends_on: linux-nix
command: 'nix develop --command scripts/todo-list.sh'
agents:
system: ${linux}
env:
TMPDIR: "/cache"
- label: 'Lint bash shell scripts'
depends_on: linux-nix
commands:
- 'echo +++ Shellcheck'
- './scripts/shellcheck.sh'
agents:
system: ${linux}
env:
TMPDIR: "/cache"
- label: 'Check HLS works'
depends_on: linux-nix
command: |
ln -sf hie-direnv.yaml hie.yaml
nix develop --command bash -c "haskell-language-server lib/wallet/src/Cardano/Wallet.hs"
agents:
system: ${linux}
env:
TMPDIR: "/cache"
- block: 'Run integration tests (linux)'
if: '(build.branch != "staging") && (build.branch != "trying") && (build.branch != "master")'
key: trigger-linux
depends_on:
- linux-nix
- label: 'Run integration tests (linux)'
command: 'nix build -L .#ci.${linux}.tests.run.integration'
depends_on: trigger-linux
agents:
system: ${linux}
env:
TMPDIR: "/cache"
- block: 'Run benchmark (api)'
depends_on: linux-nix
key: trigger-benchmark-api
- label: 'Run benchmark (api)'
command: "./.buildkite/bench-api.sh"
depends_on: trigger-benchmark-api
timeout_in_minutes: 20
agents:
system: x86_64-linux
# We do not use the benchmark queue here, as we don't want
# to use system resources that are intended for long-running processes
# to perform quick-and-dirty benchmark runs.
# queue: benchmark
if: 'build.env("step") == null || build.env("step") =~ /bench-api/'
env:
TMPDIR: "/cache"
- label: 'Check nix (macOS)'
key: macos-nix
depends_on: linux-nix
commands:
- './nix/regenerate.sh'
agents:
system: ${macos}
- block: "macOS test"
depends_on: macos-nix
if: 'build.branch != "master"'
key: trigger-macos-test
- label: 'Run unit tests (macOS)'
depends_on: trigger-macos-test
key: macos-build-tests
command: 'GC_DONT_GC=1 nix build --max-silent-time 0 --max-jobs 1 -L .#ci.${macos}.tests.run.unit'
agents:
system: ${macos}
- block: "macOS package"
depends_on: macos-nix
if: '(build.branch != "staging") && (build.branch != "trying") && (build.branch != "master")'
key: trigger-macos-package
- label: 'Build package (macOS)'
depends_on: trigger-macos-package
key: build-macos
command: nix build --max-silent-time 0 --max-jobs 1 -o result/macos-intel .#ci.artifacts.macos-intel.release
artifact_paths: [ "./result/macos-intel/**" ]
agents:
system: ${macos}
- block: "Build package (linux)"
depends_on: linux-nix
if: '(build.branch != "staging") && (build.branch != "trying") && (build.branch != "master")'
key: trigger-build-linux-package
- label: 'Build package (linux)'
depends_on: [linux-nix, trigger-build-linux-package]
key: build-linux
command: nix build -o result/linux .#ci.artifacts.linux64.release
artifact_paths: [ "./result/linux/**" ]
agents:
system: ${linux}
env:
TMPDIR: "/cache"
- block: "Build windows artifacts"
depends_on: linux-nix
if: '(build.branch != "staging") && (build.branch != "trying") && (build.branch != "master")'
key: trigger-build-windows-artifacts
- label: 'Build package (windows)'
depends_on: [linux-nix, trigger-build-windows-artifacts]
key: build-windows
command: nix build -o result/windows .#ci.artifacts.win64.release
artifact_paths: [ "./result/windows/**" ]
agents:
system: ${linux}
env:
TMPDIR: "/cache"
- label: 'Build testing bundle (windows)'
depends_on: [linux-nix, trigger-build-windows-artifacts]
key: build-windows-tests
command: nix build -o result/windows-tests .#ci.artifacts.win64.tests
artifact_paths: [ "./result/windows-tests/**" ]
agents:
system: ${linux}
env:
TMPDIR: "/cache"