aboutsummaryrefslogtreecommitdiff
path: root/.circleci/config.yml
blob: 7deb7e82097e4f59f6626253a310e647aa14e94f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
defaults: &defaults
  docker:
    - image: fpco/stack-build:lts
  steps:
    - checkout
    - run:
        name: Copy provided stack.yaml to stack-build.txt
        command: cp ${STACK_FILE} stack-build.txt
    - restore_cache:
        name: Restore Cached Dependencies
        keys:
          - haskell-code-explorer-v1-{{ checksum "stack-build.txt" }}
    - run:
        name: Resolve/Update Dependencies
        command: stack --stack-yaml=${STACK_FILE} setup
    - run:
        name: Build
        command: stack --stack-yaml=${STACK_FILE} -j 2 build --test --no-run-tests
    - run:
        name: Install cabal-install
        command: stack --stack-yaml=${STACK_FILE} -j 2 install cabal-install
    - run:
        name: Update list of packages
        command: stack --stack-yaml=${STACK_FILE} exec --no-ghc-package-path cabal -- update
    - run:
        name: Run tests
        command: stack --stack-yaml=${STACK_FILE} test || stack --stack-yaml=${STACK_FILE} exec --no-ghc-package-path $(stack --stack-yaml=${STACK_FILE} path --dist-dir)/build/test/test
    - save_cache:
        name: Cache Dependencies
        key: haskell-code-explorer-v1-{{ checksum "stack-build.txt" }}
        paths:
          - "/root/.stack"
          - "/root/.cache"
          - "/root/.cabal"
          - ".stack-work"

version: 2
jobs:
  ghc-8.0.2:
    environment:
      - STACK_FILE: "stack-8.0.2.yaml"
    <<: *defaults

  ghc-8.2.2:
    environment:
      - STACK_FILE: "stack-8.2.2.yaml"
    <<: *defaults

  ghc-8.4.3:
    environment:
      - STACK_FILE: "stack-8.4.3.yaml"
    <<: *defaults

  ghc-8.4.4:
    environment:
      - STACK_FILE: "stack-8.4.4.yaml"
    <<: *defaults

  ghc-8.6.3:
    environment:
      - STACK_FILE: "stack-8.6.3.yaml"
    <<: *defaults

  ghc-8.6.4:
    environment:
      - STACK_FILE: "stack-8.6.4.yaml"
    <<: *defaults
    
  ghc-8.6.5:
    environment:
      - STACK_FILE: "stack-8.6.5.yaml"
    <<: *defaults 

workflows:
  version: 2
  build_and_test:
    jobs:
      - ghc-8.0.2
      - ghc-8.2.2
      - ghc-8.4.3
      - ghc-8.4.4
      - ghc-8.6.3
      - ghc-8.6.4
      - ghc-8.6.5