config.yml 6.8 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
  - &configure_unix_32
    run:
      name: Configure
      command: |
38
        setarch i386 ./configure --with-ghc=/opt/ghc-i386/8.4.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
60 61 62 63 64 65
      command: |
        mkdir -p test-results
        make test SKIP_PERF_TESTS=YES JUNIT_FILE=../../test-results/junit.xml
  - &store_test_results
    store_test_results:
      path: test-results
66 67 68
  - &slowtest
    run:
      name: Full Test
Ben Gamari's avatar
Ben Gamari committed
69
      command: make slowtest SKIP_PERF_TESTS=YES
70 71 72 73
  - &bindist
    run:
      name: Create bindist
      command: make binary-dist
74 75 76
      # Building bindist takes ~15 minutes without output, account for
      # that.
      no_output_timeout: "30m"
Mark Karpov's avatar
Mark Karpov committed
77
  - &storeartifacts
78
    run:
Mark Karpov's avatar
Mark Karpov committed
79
      name: Store artifacts
80
      command: |
Mark Karpov's avatar
Mark Karpov committed
81 82 83 84 85 86 87
        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-.*/
88 89 90 91

jobs:
  "validate-x86_64-linux":
    resource_class: xlarge
Mathieu Boespflug's avatar
Mathieu Boespflug committed
92
    docker:
93
      - image: ghcci/x86_64-linux:0.0.2
94 95
    environment:
      <<: *buildenv
Mark Karpov's avatar
Mark Karpov committed
96
      GHC_COLLECTOR_FLAVOR: x86_64-linux
97 98 99 100
    steps:
      - checkout
      - *prepare
      - *submodules
101 102 103 104 105
      - *boot
      - *configure_unix
      - *make
      - *bindist
      - *storeartifacts
106
      - *test
107
      - *store_test_results
108 109

  "validate-x86_64-freebsd":
Mathieu Boespflug's avatar
Mathieu Boespflug committed
110
    resource_class: xlarge
111
    docker:
Mark Karpov's avatar
Mark Karpov committed
112
      - image: ghcci/x86_64-freebsd
113 114
    environment:
      TARGET: FreeBSD
115
      <<: *buildenv
Mark Karpov's avatar
Mark Karpov committed
116
      GHC_COLLECTOR_FLAVOR: x86_64-freebsd
117 118 119 120
    steps:
      - checkout
      - *prepare
      - *submodules
121 122 123 124 125
      - *boot
      - *configure_bsd
      - *make
      - *bindist
      - *storeartifacts
126
      - *test
127
      - *store_test_results
128 129 130 131

  "validate-x86_64-darwin":
    macos:
      xcode: "9.0"
Ben Gamari's avatar
Ben Gamari committed
132 133 134 135
    environment:
      MACOSX_DEPLOYMENT_TARGET: "10.7"
      # Only Sierra and onwards supports clock_gettime. See #12858
      ac_cv_func_clock_gettime: "no"
136 137
    environment:
      <<: *buildenv
Mark Karpov's avatar
Mark Karpov committed
138
      GHC_COLLECTOR_FLAVOR: x86_64-darwin
Mathieu Boespflug's avatar
Mathieu Boespflug committed
139
    steps:
140 141 142
      - checkout
      - *prepare
      - *submodules
143 144 145 146
      - *boot
      - *configure_unix
      - *make
      - *bindist
147
      - *storeartifacts
148
      - *test
149
      - *store_test_results
150

Ben Gamari's avatar
Ben Gamari committed
151 152 153
  "validate-hadrian-x86_64-linux":
    resource_class: xlarge
    docker:
154
      - image: ghcci/x86_64-linux:0.0.2
Ben Gamari's avatar
Ben Gamari committed
155 156 157 158 159 160 161 162 163 164
    environment:
      <<: *buildenv
    steps:
      - checkout
      - *prepare
      - *submodules
      - *boot
      - *configure_unix
      - *build_hadrian

165 166 167
  "validate-x86_64-linux-unreg":
    resource_class: xlarge
    docker:
168
      - image: ghcci/x86_64-linux:0.0.2
169 170 171 172 173 174 175 176 177 178
    environment:
      <<: *buildenv
    steps:
      - checkout
      - *prepare
      - *submodules
      - *boot
      - *configure_unreg
      - *make
      - *test
179
      - *store_test_results
180

181 182 183
  "validate-x86_64-linux-llvm":
    resource_class: xlarge
    docker:
184
      - image: ghcci/x86_64-linux:0.0.2
185 186 187 188 189 190 191
    environment:
      <<: *buildenv
      BUILD_FLAVOUR: perf-llvm
    steps:
      - run:
          name: Install LLVM
          command: |
192 193
            curl http://releases.llvm.org/6.0.0/clang+llvm-6.0.0-x86_64-linux-gnu-debian8.tar.xz | tar -xJC ..
            echo "export PATH=`pwd`/../clang+llvm-6.0.0-x86_64-linux-gnu-debian8/bin:\$PATH" >> $BASH_ENV
194 195 196 197 198 199 200 201 202 203 204
      - run:
          name: Verify that llc works
          command: llc
      - checkout
      - *prepare
      - *submodules
      - *boot
      - *configure_unix
      - *make
      - *slowtest

205 206 207 208
  # Nightly build with -DDEBUG using devel2 flavour
  "validate-x86_64-linux-debug":
    resource_class: xlarge
    docker:
209
      - image: ghcci/x86_64-linux:0.0.2
210 211 212 213 214 215 216 217 218 219 220
    environment:
      BUILD_FLAVOUR: devel2
      <<: *buildenv
    steps:
      - checkout
      - *prepare
      - *submodules
      - *boot
      - *configure_unreg
      - *make
      - *test
221
      - *store_test_results
222

223 224 225
  "validate-i386-linux":
    resource_class: xlarge
    docker:
226
      - image: ghcci/i386-linux:0.0.2
227 228
    environment:
      <<: *buildenv
Mark Karpov's avatar
Mark Karpov committed
229
      GHC_COLLECTOR_FLAVOR: i386-linux
230 231 232 233 234 235 236 237 238
    steps:
      - checkout
      - *prepare
      - *submodules
      - *boot
      - *configure_unix_32
      - *make
      - *bindist
      - *storeartifacts
239
      - *test
240
      - *store_test_results
241

Mark Karpov's avatar
Mark Karpov committed
242 243 244
  "validate-x86_64-fedora":
    resource_class: xlarge
    docker:
245
      - image: ghcci/x86_64-linux-fedora:0.0.4
Mark Karpov's avatar
Mark Karpov committed
246 247
    environment:
      <<: *buildenv
248
      GHC_COLLECTOR_FLAVOR: x86_64-fedora
Mark Karpov's avatar
Mark Karpov committed
249 250 251 252 253 254 255 256 257
    steps:
      - checkout
      - *prepare
      - *submodules
      - *boot
      - *configure_unix
      - *make
      - *bindist
      - *storeartifacts
258
      - *test
259
      - *store_test_results
Mark Karpov's avatar
Mark Karpov committed
260

261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276
  "slow-validate-x86_64-linux":
    resource_class: xlarge
    docker:
      - image: ghcci/x86_64-linux:0.0.2
    environment:
      <<: *buildenv
      GHC_COLLECTOR_FLAVOR: x86_64-linux
    steps:
      - checkout
      - *prepare
      - *submodules
      - *boot
      - *configure_unix
      - *make
      - *slowtest

277 278 279 280
workflows:
  version: 2
  validate:
    jobs:
Mark Karpov's avatar
Mark Karpov committed
281 282
    - validate-x86_64-linux:
        *trigger_on_tags
283 284
    # FreeBSD disabled: https://github.com/haskell/unix/issues/102
    # - validate-x86_64-freebsd
Mark Karpov's avatar
Mark Karpov committed
285 286
    - validate-x86_64-darwin:
        *trigger_on_tags
287
    - validate-x86_64-linux-llvm
Mark Karpov's avatar
Mark Karpov committed
288 289
    - validate-i386-linux:
        *trigger_on_tags
Ben Gamari's avatar
Ben Gamari committed
290
    - validate-hadrian-x86_64-linux
Mark Karpov's avatar
Mark Karpov committed
291 292
    - validate-x86_64-fedora:
        *trigger_on_tags
293

294 295 296 297 298 299 300 301 302 303
  nightly:
    triggers:
      - schedule:
          cron: "0 0 * * *"
          filters:
            branches:
              only:
                - master
    jobs:
    - validate-x86_64-linux-unreg
304
    - validate-x86_64-linux-llvm
305
    - validate-x86_64-linux-debug
306
    - slow-validate-x86_64-linux
307

308 309 310
notify:
  webhooks:
    - url: https://phabricator.haskell.org/harbormaster/hook/circleci/