-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
88 lines (86 loc) · 2.58 KB
/
config.yml
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
85
86
87
88
version: 2
aliases:
- &default_env
environment:
CACHE_KEY: 0
STACK_VERSION: 1.7.1
- &create_cache_key_file
run:
name: Create cache control key file
command: echo $CACHE_KEY > cache_key
- &restore_build_results
restore_cache:
keys:
- stack-{{ checksum "cache_key" }}-{{ checksum "stack.yaml" }}-{{ checksum "package.yaml" }}
- stack-{{ checksum "cache_key" }}-{{ checksum "stack.yaml" }}
- stack-{{ checksum "cache_key" }}
- &save_build_results
save_cache:
key: stack-{{ checksum "cache_key" }}-{{ checksum "stack.yaml" }}-{{ checksum "package.yaml" }}
paths:
- ~/.stack
- ~/.local/bin
- .stack-work
- &display_stack_version
run:
name: Display stack version
command: |
stack upgrade --binary-version=$STACK_VERSION
stack --version
jobs:
build:
docker:
- image: quay.io/haskell_works/stack-build-minimal
<<: *default_env
steps:
- checkout
- *create_cache_key_file
- *restore_build_results
- *display_stack_version
- run:
name: Install dependencies
command: stack test --only-dependencies --no-terminal --no-run-tests
no_output_timeout: 120m
- run:
name: Run stack test
command: stack test --fast
- *save_build_results
pedantic:
docker:
- image: quay.io/haskell_works/stack-build-minimal
<<: *default_env
steps:
- checkout
- *create_cache_key_file
- *restore_build_results
- *display_stack_version
- run:
name: Run stack test --pedantic
command: |
stack clean
stack test --pedantic --fast --no-run-tests
check:
docker:
- image: quay.io/haskell_works/stack-build-minimal
steps:
- checkout
- run:
name: Run HLint
command: |
curl -sL https://raw.github.com/ndmitchell/hlint/master/misc/travis.sh | sh -s -- --version
curl -sL https://raw.github.com/ndmitchell/hlint/master/misc/travis.sh | sh -s .
- run:
name: Run stylish-haskell
command: |
# TODO: https://github.com/jaspervdj/stylish-haskell/pull/218
curl -sL https://raw.githubusercontent.com/waddlaw/stylish-haskell/master/scripts/latest.sh | sh -s -- -i $(find . -type f -name "*hs" -not -path '.git' -not -path '*.stack-work*')
git --no-pager diff --exit-code
workflows:
version: 2
test-check:
jobs:
- build
- pedantic:
requires:
- build
- check