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