-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
105 lines (88 loc) · 2.77 KB
/
circle.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
version: 2.0
jobs:
build:
working_directory: ~/project
docker:
- image: quay.io/haskell_works/stack-build-cabal:2018-01-29
steps:
- checkout
##### Copying scripts
- run:
name: Copying scripts
command: |
mkdir -p ~/.local/bin
cp ./scripts/* ~/.local/bin
##### Updating cabval package list
- run:
name: Updating cabal package list date stamp
command: date +%F > dot-cabal-cache-date
- restore_cache:
keys:
- dot-cabal-{{ checksum "dot-cabal-cache-date" }}
- dot-cabal
- run:
name: Updating cabal package list
command: cabal update
- save_cache:
key: dot-cabal-{{ checksum "dot-cabal-cache-date" }}
paths:
- ~/.cabal
- save_cache:
key: dot-cabal
paths:
- ~/.cabal
- restore_cache:
keys:
- dot-stack-{{ checksum "stack.yaml" }}-{{ checksum "package.yaml" }}
- dot-stack-{{ checksum "stack.yaml" }}-build
- dot-stack-{{ checksum "stack.yaml" }}-setup
- run:
name: Fetching latest organisation package versions
command: |
fetch
echo "== stack-ci.yaml =="
cat stack-ci.yaml
- restore_cache:
key: dot-stack-work-{{ checksum "stack.yaml" }}
- run:
name: Stack setup
command: stack setup
- save_cache:
key: dot-stack-{{ checksum "stack.yaml" }}-setup
paths:
- ~/.stack
- run:
name: Building dependencies
command: stack --stack-yaml stack-ci.yaml build --only-dependencies
- run:
name: Compiling
command: stack --stack-yaml stack-ci.yaml build --test --no-run-tests --bench --no-run-benchmarks
- save_cache:
key: dot-stack-{{ checksum "stack.yaml" }}-{{ checksum "package.yaml" }}
paths:
- ~/.stack
- save_cache:
key: dot-stack-{{ checksum "stack.yaml" }}-build
paths:
- ~/.stack
- save_cache:
key: dot-stack-work-{{ checksum "stack.yaml" }}
paths: ~/project/.stack-work
##### Running tests
- run:
name: Running tests against latest on hackage
command: stack --stack-yaml stack-ci.yaml test
- deploy:
command: |
if [ "$CIRCLE_PROJECT_USERNAME" == "haskell-works" ]; then
if [[ "$CIRCLE_BRANCH" == master ]]; then
when tag autotag
elif [[ "$CIRCLE_TAG" =~ v.* ]]; then
publish
fi
fi
deployment:
tagged_builds:
tag: /v.*/
commands:
- echo "Make tags run in 2.0"