Fix GHC collector flavor for Fedora job (Circle CI)
[ghc.git] / .circleci / config.yml
1 version: 2
2
3 aliases:
4   - &defaults
5     working_directory: ~/ghc
6   - &prepare
7     run:
8       name: prepare-system
9       command: .circleci/prepare-system.sh
10   - &submodules
11     run:
12       name: submodules
13       command: .circleci/fetch-submodules.sh
14   - &buildenv
15     THREADS: 9
16     SKIP_PERF_TESTS: YES
17     VERBOSE: 2
18   - &boot
19     run:
20       name: Boot
21       command: |
22         ./boot
23
24         cat <<EOF >> mk/build.mk
25         BuildFlavour=$BUILD_FLAVOUR
26         ifneq "\$(BuildFlavour)" ""
27         include mk/flavours/\$(BuildFlavour).mk
28         endif
29         EOF
30   - &configure_unix
31     run:
32       name: Configure
33       command: ./configure
34   - &configure_unix_32
35     run:
36       name: Configure
37       command: |
38         setarch i386 ./configure --with-ghc=/opt/ghc-i386/8.2.2/bin/ghc
39   - &configure_bsd
40     run:
41       name: Configure
42       command: ./configure --target=x86_64-unknown-freebsd10
43   - &configure_unreg
44     run:
45       name: Configure
46       command: ./configure --enable-unregisterised
47   - &make
48     run:
49       name: Build
50       command: "make -j$THREADS"
51   - &build_hadrian
52     run:
53       name: Build GHC using Hadrian
54       command: |
55         cabal update
56         hadrian/build.sh -j$THREADS
57   - &test
58     run:
59       name: Test
60       command: make test SKIP_PERF_TESTS=YES
61   - &slowtest
62     run:
63       name: Full Test
64       command: make slowtest SKIP_PERF_TESTS=YES
65   - &bindist
66     run:
67       name: Create bindist
68       command: make binary-dist
69       # Building bindist takes ~15 minutes without output, account for
70       # that.
71       no_output_timeout: "30m"
72   - &storeartifacts
73     run:
74       name: Store artifacts
75       command: |
76         curl https://ghc-artifacts.s3.amazonaws.com/tools/ghc-artifact-collector-$GHC_COLLECTOR_FLAVOR --output ghc-artifact-collector
77         chmod +x ghc-artifact-collector
78         ./ghc-artifact-collector ghc*.tar.xz
79   - &trigger_on_tags
80     filters:
81       tags:
82         only: /^ghc-.*/
83
84 jobs:
85   "validate-x86_64-linux":
86     resource_class: xlarge
87     docker:
88       - image: ghcci/x86_64-linux:0.0.1
89     environment:
90       <<: *buildenv
91       GHC_COLLECTOR_FLAVOR: x86_64-linux
92     steps:
93       - checkout
94       - *prepare
95       - *submodules
96       - *boot
97       - *configure_unix
98       - *make
99       - *bindist
100       - *storeartifacts
101       - *test
102
103   "validate-x86_64-freebsd":
104     resource_class: xlarge
105     docker:
106       - image: ghcci/x86_64-freebsd
107     environment:
108       TARGET: FreeBSD
109       <<: *buildenv
110       GHC_COLLECTOR_FLAVOR: x86_64-freebsd
111     steps:
112       - checkout
113       - *prepare
114       - *submodules
115       - *boot
116       - *configure_bsd
117       - *make
118       - *bindist
119       - *storeartifacts
120       - *test
121
122   "validate-x86_64-darwin":
123     macos:
124       xcode: "9.0"
125     environment:
126       MACOSX_DEPLOYMENT_TARGET: "10.7"
127       # Only Sierra and onwards supports clock_gettime. See #12858
128       ac_cv_func_clock_gettime: "no"
129     environment:
130       <<: *buildenv
131       GHC_COLLECTOR_FLAVOR: x86_64-darwin
132     steps:
133       - checkout
134       - *prepare
135       - *submodules
136       - *boot
137       - *configure_unix
138       - *make
139       - *bindist
140       - *storeartifacts
141       - *test
142
143   "validate-hadrian-x86_64-linux":
144     resource_class: xlarge
145     docker:
146       - image: ghcci/x86_64-linux:0.0.1
147     environment:
148       <<: *buildenv
149     steps:
150       - checkout
151       - *prepare
152       - *submodules
153       - *boot
154       - *configure_unix
155       - *build_hadrian
156
157   "validate-x86_64-linux-unreg":
158     resource_class: xlarge
159     docker:
160       - image: ghcci/x86_64-linux:0.0.1
161     environment:
162       <<: *buildenv
163     steps:
164       - checkout
165       - *prepare
166       - *submodules
167       - *boot
168       - *configure_unreg
169       - *make
170       - *test
171
172   "validate-x86_64-linux-llvm":
173     resource_class: xlarge
174     docker:
175       - image: ghcci/x86_64-linux:0.0.1
176     environment:
177       <<: *buildenv
178       BUILD_FLAVOUR: perf-llvm
179     steps:
180       - run:
181           name: Install LLVM
182           command: |
183             curl http://releases.llvm.org/5.0.0/clang+llvm-5.0.0-x86_64-linux-gnu-debian8.tar.xz | tar -xJC ..
184             echo "export PATH=`pwd`/../clang+llvm-5.0.0-x86_64-linux-gnu-debian8/bin:\$PATH" >> $BASH_ENV
185       - run:
186           name: Verify that llc works
187           command: llc
188       - checkout
189       - *prepare
190       - *submodules
191       - *boot
192       - *configure_unix
193       - *make
194       - *slowtest
195
196   # Nightly build with -DDEBUG using devel2 flavour
197   "validate-x86_64-linux-debug":
198     resource_class: xlarge
199     docker:
200       - image: ghcci/x86_64-linux:0.0.1
201     environment:
202       BUILD_FLAVOUR: devel2
203       <<: *buildenv
204     steps:
205       - checkout
206       - *prepare
207       - *submodules
208       - *boot
209       - *configure_unreg
210       - *make
211       - *test
212
213   "validate-i386-linux":
214     resource_class: xlarge
215     docker:
216       - image: ghcci/i386-linux:0.0.1
217     environment:
218       <<: *buildenv
219       GHC_COLLECTOR_FLAVOR: i386-linux
220     steps:
221       - checkout
222       - *prepare
223       - *submodules
224       - *boot
225       - *configure_unix_32
226       - *make
227       - *bindist
228       - *storeartifacts
229       - *test
230
231   "validate-x86_64-fedora":
232     resource_class: xlarge
233     docker:
234       - image: ghcci/x86_64-linux-fedora:0.0.2
235     environment:
236       <<: *buildenv
237       GHC_COLLECTOR_FLAVOR: x86_64-fedora
238     steps:
239       - checkout
240       - *prepare
241       - *submodules
242       - *boot
243       - *configure_unix
244       - *make
245       - *bindist
246       - *storeartifacts
247       - *test
248
249 workflows:
250   version: 2
251   validate:
252     jobs:
253     - validate-x86_64-linux:
254         *trigger_on_tags
255     # FreeBSD disabled: https://github.com/haskell/unix/issues/102
256     # - validate-x86_64-freebsd
257     - validate-x86_64-darwin:
258         *trigger_on_tags
259     - validate-x86_64-linux-llvm
260     - validate-i386-linux:
261         *trigger_on_tags
262     - validate-hadrian-x86_64-linux
263     - validate-x86_64-fedora:
264         *trigger_on_tags
265
266   nightly:
267     triggers:
268       - schedule:
269           cron: "0 0 * * *"
270           filters:
271             branches:
272               only:
273                 - master
274     jobs:
275     - validate-x86_64-linux-unreg
276     - validate-x86_64-linux-llvm
277     - validate-x86_64-linux-debug
278
279 notify:
280   webhooks:
281     - url: https://phabricator.haskell.org/harbormaster/hook/circleci/