gitlab-ci: Enable darwin builds
[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.1
116   cache:
117     key: linux-x86_64-deb9
118
119 validate-x86_64-linux-deb8:
120   extends: .validate-linux
121   image: ghcci/x86_64-linux-deb8:0.1
122   cache:
123     key: linux-x86_64-deb8
124   artifacts:
125     when: always
126
127 validate-x86_64-linux-fedora27:
128   extends: .validate-linux
129   image: ghcci/x86_64-linux-fedora27:0.1
130   cache:
131     key: linux-x86_64-fedora27
132   artifacts:
133     when: always
134
135 validate-x86_64-linux-deb9-integer-simple:
136   extends: .validate-linux
137   variables:
138     INTEGER_LIBRARY: integer-simple
139   image: ghcci/x86_64-linux-deb9:0.1
140   cache:
141     key: linux-x86_64-deb9
142
143 validate-x86_64-linux-deb9-unreg:
144   extends: .validate-linux
145   variables:
146     CONFIGURE_ARGS: --enable-unregisterised
147   image: ghcci/x86_64-linux-deb9:0.1
148   cache:
149     key: linux-x86_64-deb9
150
151 ############################################################
152 # Validation via Pipelines (make, Windows)
153 ############################################################
154
155 .validate-x86_64-windows:
156   variables:
157     GHC_VERSION: "8.6.2"
158   script:
159     - bash -e .gitlab/win32-init.sh
160     - |
161       set MSYSTEM=MINGW64
162       python boot
163       bash -c './configure --with-ghc=`pwd`/toolchain/bin/ghc --enable-tarballs-autodownload HappyCmd=`pwd`/toolchain/bin/happy AlexCmd=`pwd`/toolchain/bin/alex'
164       mkdir -p _build
165       cp -R inplace/mingw _build/mingw
166     - bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --flavour=Quick"
167     - bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh binary-dist"
168     - mv ghc-*.tar.xz ghc.tar.xz
169     - bash -c 'make V=0 -j`mk/detect-cpu-count.sh` HADDOCK_DOCS=NO test THREADS=$THREADS JUNIT_FILE=../../junit.xml'
170     - cp -Rf $APPDATA/cabal cabal-cache
171   cache:
172     key: windows
173     paths:
174       - cabal-cache
175       - ghc-8.6.2
176       - ghc-tarballs
177   tags:
178     - x86_64-windows
179
180
181 ############################################################
182 # Validation via CircleCI
183 ############################################################
184
185 .circleci:
186   image: ghcci/x86_64-linux-deb8:0.1
187   artifacts:
188     when: always
189     reports:
190       junit: junit.xml
191     paths:
192       - ghc.tar.xz
193       - junit.xml
194   tags:
195     - circleci
196
197 # All validation jobs keep the bindists and test results are artifacts,
198 # when we get far enough to generate them.
199 #
200 # This requires updating the maximum artifacts size limit in Gitlab to
201 # something like 200MB.
202
203 circleci-validate-x86_64-linux-deb8:
204   extends: .circleci
205   script: ".gitlab/circle-ci-job.sh validate-x86_64-linux-deb8"
206
207 circleci-validate-i386-linux-deb8:
208   extends: .circleci
209   script: ".gitlab/circle-ci-job.sh validate-i386-linux-deb8"
210
211 # circleci-validate-x86_64-freebsd:
212 #   extends: .circleci
213 #   script: ".gitlab/circle-ci-job.sh validate-x86_64-freebsd"
214
215 circleci-validate-x86_64-darwin:
216   extends: .circleci
217   script: ".gitlab/circle-ci-job.sh validate-x86_64-darwin"