config.yml 6.11 KB
Newer Older
Mathieu Boespflug's avatar
Mathieu Boespflug committed
1
version: 2
2
3
4

aliases:
  - &defaults
Mathieu Boespflug's avatar
Mathieu Boespflug committed
5
    working_directory: ~/ghc
6
7
8
9
10
11
12
13
  - &prepare
    run:
      name: prepare-system
      command: .circleci/prepare-system.sh
  - &submodules
    run:
      name: submodules
      command: .circleci/fetch-submodules.sh
14
  - &buildenv
15
    THREADS: 9
16
17
18
19
20
    SKIP_PERF_TESTS: YES
    VERBOSE: 2
  - &boot
    run:
      name: Boot
21
22
23
24
25
26
27
28
29
      command: |
        ./boot

        cat <<EOF >> mk/build.mk
        BuildFlavour=$BUILD_FLAVOUR
        ifneq "\$(BuildFlavour)" ""
        include mk/flavours/\$(BuildFlavour).mk
        endif
        EOF
30
31
32
33
  - &configure_unix
    run:
      name: Configure
      command: ./configure
34
35
36
37
38
  - &configure_unix_32
    run:
      name: Configure
      command: |
        setarch i386 ./configure --with-ghc=/opt/ghc-i386/8.2.2/bin/ghc
39
40
41
42
  - &configure_bsd
    run:
      name: Configure
      command: ./configure --target=x86_64-unknown-freebsd10
43
44
45
46
  - &configure_unreg
    run:
      name: Configure
      command: ./configure --enable-unregisterised
47
  - &make
48
    run:
49
50
      name: Build
      command: "make -j$THREADS"
Ben Gamari's avatar
Ben Gamari committed
51
52
53
54
  - &build_hadrian
    run:
      name: Build GHC using Hadrian
      command: |
Ben Gamari's avatar
Ben Gamari committed
55
56
        cabal update
        hadrian/build.sh -j$THREADS
57
58
59
  - &test
    run:
      name: Test
Ben Gamari's avatar
Ben Gamari committed
60
      command: make test SKIP_PERF_TESTS=YES
61
62
63
  - &slowtest
    run:
      name: Full Test
Ben Gamari's avatar
Ben Gamari committed
64
      command: make slowtest SKIP_PERF_TESTS=YES
65
66
67
68
  - &bindist
    run:
      name: Create bindist
      command: make binary-dist
69
70
71
      # Building bindist takes ~15 minutes without output, account for
      # that.
      no_output_timeout: "30m"
Mark Karpov's avatar
Mark Karpov committed
72
  - &storeartifacts
73
    run:
Mark Karpov's avatar
Mark Karpov committed
74
      name: Store artifacts
75
      command: |
Mark Karpov's avatar
Mark Karpov committed
76
77
78
79
80
81
82
        curl https://ghc-artifacts.s3.amazonaws.com/tools/ghc-artifact-collector-$GHC_COLLECTOR_FLAVOR --output ghc-artifact-collector
        chmod +x ghc-artifact-collector
        ./ghc-artifact-collector ghc*.tar.xz
  - &trigger_on_tags
    filters:
      tags:
        only: /^ghc-.*/
83
84
85
86

jobs:
  "validate-x86_64-linux":
    resource_class: xlarge
Mathieu Boespflug's avatar
Mathieu Boespflug committed
87
    docker:
Mark Karpov's avatar
Mark Karpov committed
88
      - image: ghcci/x86_64-linux:0.0.1
89
90
    environment:
      <<: *buildenv
Mark Karpov's avatar
Mark Karpov committed
91
      GHC_COLLECTOR_FLAVOR: x86_64-linux
92
93
94
95
    steps:
      - checkout
      - *prepare
      - *submodules
96
97
98
99
100
      - *boot
      - *configure_unix
      - *make
      - *bindist
      - *storeartifacts
101
      - *test
102
103

  "validate-x86_64-freebsd":
Mathieu Boespflug's avatar
Mathieu Boespflug committed
104
    resource_class: xlarge
105
    docker:
Mark Karpov's avatar
Mark Karpov committed
106
      - image: ghcci/x86_64-freebsd
107
108
    environment:
      TARGET: FreeBSD
109
      <<: *buildenv
Mark Karpov's avatar
Mark Karpov committed
110
      GHC_COLLECTOR_FLAVOR: x86_64-freebsd
111
112
113
114
    steps:
      - checkout
      - *prepare
      - *submodules
115
116
117
118
119
      - *boot
      - *configure_bsd
      - *make
      - *bindist
      - *storeartifacts
120
      - *test
121
122
123
124

  "validate-x86_64-darwin":
    macos:
      xcode: "9.0"
Ben Gamari's avatar
Ben Gamari committed
125
126
127
128
    environment:
      MACOSX_DEPLOYMENT_TARGET: "10.7"
      # Only Sierra and onwards supports clock_gettime. See #12858
      ac_cv_func_clock_gettime: "no"
129
130
    environment:
      <<: *buildenv
Mark Karpov's avatar
Mark Karpov committed
131
      GHC_COLLECTOR_FLAVOR: x86_64-darwin
Mathieu Boespflug's avatar
Mathieu Boespflug committed
132
    steps:
133
134
135
      - checkout
      - *prepare
      - *submodules
136
137
138
139
      - *boot
      - *configure_unix
      - *make
      - *bindist
140
      - *storeartifacts
141
      - *test
142

Ben Gamari's avatar
Ben Gamari committed
143
144
145
  "validate-hadrian-x86_64-linux":
    resource_class: xlarge
    docker:
Mark Karpov's avatar
Mark Karpov committed
146
      - image: ghcci/x86_64-linux:0.0.1
Ben Gamari's avatar
Ben Gamari committed
147
148
149
150
151
152
153
154
155
156
    environment:
      <<: *buildenv
    steps:
      - checkout
      - *prepare
      - *submodules
      - *boot
      - *configure_unix
      - *build_hadrian

157
158
159
  "validate-x86_64-linux-unreg":
    resource_class: xlarge
    docker:
Mark Karpov's avatar
Mark Karpov committed
160
      - image: ghcci/x86_64-linux:0.0.1
161
162
163
164
165
166
167
168
169
170
171
    environment:
      <<: *buildenv
    steps:
      - checkout
      - *prepare
      - *submodules
      - *boot
      - *configure_unreg
      - *make
      - *test

172
173
174
  "validate-x86_64-linux-llvm":
    resource_class: xlarge
    docker:
Mark Karpov's avatar
Mark Karpov committed
175
      - image: ghcci/x86_64-linux:0.0.1
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
    environment:
      <<: *buildenv
      BUILD_FLAVOUR: perf-llvm
    steps:
      - run:
          name: Install LLVM
          command: |
            curl http://releases.llvm.org/5.0.0/clang+llvm-5.0.0-x86_64-linux-gnu-debian8.tar.xz | tar -xJC ..
            echo "export PATH=`pwd`/../clang+llvm-5.0.0-x86_64-linux-gnu-debian8/bin:\$PATH" >> $BASH_ENV
      - run:
          name: Verify that llc works
          command: llc
      - checkout
      - *prepare
      - *submodules
      - *boot
      - *configure_unix
      - *make
      - *slowtest

196
197
198
199
  # Nightly build with -DDEBUG using devel2 flavour
  "validate-x86_64-linux-debug":
    resource_class: xlarge
    docker:
Mark Karpov's avatar
Mark Karpov committed
200
      - image: ghcci/x86_64-linux:0.0.1
201
202
203
204
205
206
207
208
209
210
211
212
    environment:
      BUILD_FLAVOUR: devel2
      <<: *buildenv
    steps:
      - checkout
      - *prepare
      - *submodules
      - *boot
      - *configure_unreg
      - *make
      - *test

213
214
215
  "validate-i386-linux":
    resource_class: xlarge
    docker:
Mark Karpov's avatar
Mark Karpov committed
216
      - image: ghcci/i386-linux:0.0.1
217
218
    environment:
      <<: *buildenv
Mark Karpov's avatar
Mark Karpov committed
219
      GHC_COLLECTOR_FLAVOR: i386-linux
220
221
222
223
224
225
226
227
228
    steps:
      - checkout
      - *prepare
      - *submodules
      - *boot
      - *configure_unix_32
      - *make
      - *bindist
      - *storeartifacts
229
      - *test
230

Mark Karpov's avatar
Mark Karpov committed
231
232
233
234
235
236
  "validate-x86_64-fedora":
    resource_class: xlarge
    docker:
      - image: ghcci/x86_64-linux-fedora:0.0.2
    environment:
      <<: *buildenv
237
      GHC_COLLECTOR_FLAVOR: x86_64-fedora
Mark Karpov's avatar
Mark Karpov committed
238
239
240
241
242
243
244
245
246
    steps:
      - checkout
      - *prepare
      - *submodules
      - *boot
      - *configure_unix
      - *make
      - *bindist
      - *storeartifacts
247
      - *test
Mark Karpov's avatar
Mark Karpov committed
248

249
250
251
252
workflows:
  version: 2
  validate:
    jobs:
Mark Karpov's avatar
Mark Karpov committed
253
254
    - validate-x86_64-linux:
        *trigger_on_tags
255
256
    # FreeBSD disabled: https://github.com/haskell/unix/issues/102
    # - validate-x86_64-freebsd
Mark Karpov's avatar
Mark Karpov committed
257
258
    - validate-x86_64-darwin:
        *trigger_on_tags
259
    - validate-x86_64-linux-llvm
Mark Karpov's avatar
Mark Karpov committed
260
261
    - validate-i386-linux:
        *trigger_on_tags
Ben Gamari's avatar
Ben Gamari committed
262
    - validate-hadrian-x86_64-linux
Mark Karpov's avatar
Mark Karpov committed
263
264
    - validate-x86_64-fedora:
        *trigger_on_tags
265

266
267
268
269
270
271
272
273
274
275
  nightly:
    triggers:
      - schedule:
          cron: "0 0 * * *"
          filters:
            branches:
              only:
                - master
    jobs:
    - validate-x86_64-linux-unreg
276
    - validate-x86_64-linux-llvm
277
    - validate-x86_64-linux-debug
278

279
280
281
notify:
  webhooks:
    - url: https://phabricator.haskell.org/harbormaster/hook/circleci/