gitlab-ci: Add aarch64 target
[ghc.git] / .gitlab-ci.yml
1 variables:
2   GIT_SSL_NO_VERIFY: "1"
3
4 before_script:
5   - python3 .gitlab/fix-submodules.py
6   - git submodule sync --recursive
7   - git submodule update --init --recursive
8   - git checkout .gitmodules
9
10 stages:
11   - lint
12   - build
13
14 ############################################################
15 # Linting
16 ############################################################
17
18 ghc-linters:
19   stage: lint
20   image: ghcci/linters:0.1
21   script:
22     - |
23       if [ -n "$CI_MERGE_REQUEST_ID" ]; then
24         base="$(git merge-base $CI_MERGE_REQUEST_BRANCH_NAME HEAD)"
25         validate-commit-msg .git $(git rev-list $base..$CI_COMMIT_SHA)
26         submodchecker .git $(git rev-list $base..$CI_COMMIT_SHA)
27         validate-whitespace .git $(git rev-list $base..$CI_COMMIT_SHA)
28         .gitlab/linters/check-makefiles.py $base $CI_COMMIT_SHA
29         .gitlab/linters/check-cpp.py $base $CI_COMMIT_SHA
30       fi
31
32 ############################################################
33 # Validation via Pipelines (hadrian)
34 ############################################################
35
36 .validate-hadrian:
37   stage: build
38   allow_failure: true
39   script:
40     - bash .circleci/prepare-system.sh
41     - if [[ -d ./cabal-cache ]]; then cp -R ./.cabal-cache ~/.cabal-cache; fi
42     - ./boot
43     - ./configure $CONFIGURE_ARGS
44     - hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh`
45   cache:
46     key: hadrian
47     paths:
48       - cabal-cache
49
50 validate-x86_64-linux-deb8-hadrian:
51   extends: .validate-hadrian
52   image: ghcci/x86_64-linux-deb8:0.1
53   before_script:
54     # workaround for docker permissions
55     - sudo chown ghc:ghc -R .
56   tags:
57     - x86_64-linux
58
59 ############################################################
60 # Validation via Pipelines (make)
61 ############################################################
62
63 .validate:
64   stage: build
65   script:
66     - make clean || true
67     - ./boot
68     - ./configure $CONFIGURE_ARGS
69     - |
70       THREADS=`mk/detect-cpu-count.sh`
71       make V=0 -j$THREADS
72     - |
73       make binary-dist TAR_COMP_OPTS="-1"
74       mv ghc-*.tar.xz ghc.tar.xz
75     - |
76       THREADS=`mk/detect-cpu-count.sh`
77       make test THREADS=$THREADS JUNIT_FILE=../../junit.xml
78   artifacts:
79     reports:
80       junit: junit.xml
81     paths:
82       - ghc.tar.xz
83       - junit.xml
84
85 validate-x86_64-darwin:
86   extends: .validate
87   allow_failure: true
88   tags:
89     - x86_64-darwin
90   variables:
91     GHC_VERSION: 8.6.3
92     MACOSX_DEPLOYMENT_TARGET: "10.7"
93     # Only Sierra and onwards supports clock_gettime. See #12858
94     ac_cv_func_clock_gettime: "no"
95   before_script:
96     - python .gitlab/fix-submodules.py
97     - git submodule sync --recursive
98     - git submodule update --init --recursive
99     - git checkout .gitmodules
100
101     - bash .gitlab/darwin-init.sh
102     - PATH="`pwd`/toolchain/bin:$PATH"
103       # Disable sphinx PDF output as MacTeX apparently doesn't provide xelatex
104     - echo "BUILD_SPHINX_PDF=NO" >> mk/build.mk
105   after_script:
106     - cp -Rf $HOME/.cabal cabal-cache
107   artifacts:
108     when: always
109   cache:
110     key: darwin
111     paths:
112       - cabal-cache
113       - toolchain
114
115
116 .validate-linux:
117   extends: .validate
118   tags:
119     - x86_64-linux
120   before_script:
121     - python3 .gitlab/fix-submodules.py
122     - git submodule sync --recursive
123     - git submodule update --init --recursive
124     - git checkout .gitmodules
125
126     - bash .circleci/prepare-system.sh
127     # workaround for docker permissions
128     - sudo chown ghc:ghc -R .
129   after_script:
130     - cp -Rf $HOME/.cabal cabal-cache
131   cache:
132     key: linux
133     paths:
134       - cabal-cache
135       - toolchain
136
137 validate-aarch64-linux-deb9:
138   extends: .validate-linux
139   image: ghcci/aarch64-linux-deb9:0.1
140   allow_failure: true
141   artifacts:
142     when: always
143   cache:
144     key: linux-aarch64-deb9
145   tags:
146     - aarch64-linux
147
148 validate-x86_64-linux-deb9:
149   extends: .validate-linux
150   image: ghcci/x86_64-linux-deb9:0.2
151   artifacts:
152     when: always
153   cache:
154     key: linux-x86_64-deb9
155
156 validate-x86_64-linux-deb9-llvm:
157   extends: .validate-linux
158   allow_failure: true
159   image: ghcci/x86_64-linux-deb9:0.2
160   variables:
161     BUILD_FLAVOUR: perf-llvm
162   cache:
163     key: linux-x86_64-deb9
164
165 validate-x86_64-linux-deb8:
166   extends: .validate-linux
167   image: ghcci/x86_64-linux-deb8:0.1
168   cache:
169     key: linux-x86_64-deb8
170   artifacts:
171     when: always
172
173 validate-x86_64-linux-fedora27:
174   extends: .validate-linux
175   image: ghcci/x86_64-linux-fedora27:0.1
176   cache:
177     key: linux-x86_64-fedora27
178   artifacts:
179     when: always
180
181 validate-x86_64-linux-deb9-integer-simple:
182   extends: .validate-linux
183   allow_failure: true
184   variables:
185     INTEGER_LIBRARY: integer-simple
186   image: ghcci/x86_64-linux-deb9:0.2
187   cache:
188     key: linux-x86_64-deb9
189
190 validate-x86_64-linux-deb9-unreg:
191   extends: .validate-linux
192   variables:
193     CONFIGURE_ARGS: --enable-unregisterised
194   image: ghcci/x86_64-linux-deb9:0.2
195   cache:
196     key: linux-x86_64-deb9
197
198 ############################################################
199 # Validation via Pipelines (make, Windows)
200 ############################################################
201
202 .validate-x86_64-windows:
203   stage: build
204   variables:
205     GHC_VERSION: "8.6.2"
206   script:
207     - bash -e .gitlab/win32-init.sh
208     - |
209       set MSYSTEM=MINGW64
210       python boot
211       bash -c './configure --with-ghc=`pwd`/toolchain/bin/ghc --enable-tarballs-autodownload HappyCmd=`pwd`/toolchain/bin/happy AlexCmd=`pwd`/toolchain/bin/alex'
212       mkdir -p _build
213       cp -R inplace/mingw _build/mingw
214     - bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --flavour=Quick"
215     - bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh binary-dist"
216     - mv ghc-*.tar.xz ghc.tar.xz
217     - bash -c 'make V=0 -j`mk/detect-cpu-count.sh` HADDOCK_DOCS=NO test THREADS=$THREADS JUNIT_FILE=../../junit.xml'
218     - cp -Rf $APPDATA/cabal cabal-cache
219   cache:
220     key: windows
221     paths:
222       - cabal-cache
223       - ghc-8.6.2
224       - ghc-tarballs
225   tags:
226     - x86_64-windows
227
228
229 ############################################################
230 # Validation via CircleCI
231 ############################################################
232
233 .circleci:
234   stage: build
235   image: ghcci/x86_64-linux-deb8:0.1
236   artifacts:
237     when: always
238     reports:
239       junit: junit.xml
240     paths:
241       - ghc.tar.xz
242       - junit.xml
243   tags:
244     - circleci
245
246 # All validation jobs keep the bindists and test results are artifacts,
247 # when we get far enough to generate them.
248 #
249 # This requires updating the maximum artifacts size limit in Gitlab to
250 # something like 200MB.
251
252 circleci-validate-x86_64-linux-deb8:
253   extends: .circleci
254   script: ".gitlab/circle-ci-job.sh validate-x86_64-linux-deb8"
255
256 circleci-validate-i386-linux-deb8:
257   extends: .circleci
258   script: ".gitlab/circle-ci-job.sh validate-i386-linux-deb8"
259
260 # circleci-validate-x86_64-freebsd:
261 #   extends: .circleci
262 #   script: ".gitlab/circle-ci-job.sh validate-x86_64-freebsd"
263
264 circleci-validate-x86_64-darwin:
265   extends: .circleci
266   script: ".gitlab/circle-ci-job.sh validate-x86_64-darwin"