-
Notifications
You must be signed in to change notification settings - Fork 17
/
config.yml
133 lines (122 loc) · 3.59 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
version: 2.1
# Common executor configuration
executors:
clojure:
docker:
- image: circleci/clojure:openjdk-11-lein-2.9.1
working_directory: ~/repo
# Reusable job steps
commands:
install-vault:
description: "Install the Vault CLI"
steps:
- run:
name: Install vault
environment:
VAULT_VERSION: 1.8.1
command: |
wget https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip
unzip vault_${VAULT_VERSION}_linux_amd64.zip
sudo mv vault /usr/local/bin/vault
# Job definitions
jobs:
style:
executor: clojure
steps:
- checkout
- run:
name: Install cljstyle
environment:
CLJSTYLE_VERSION: 0.15.0
command: |
wget https://github.com/greglook/cljstyle/releases/download/${CLJSTYLE_VERSION}/cljstyle_${CLJSTYLE_VERSION}_linux.zip
unzip cljstyle_${CLJSTYLE_VERSION}_linux.zip
- run:
name: Check source formatting
command: "./cljstyle check --report"
lint:
executor: clojure
steps:
- checkout
- run:
name: Install clj-kondo
environment:
CLJ_KONDO_VERSION: 2022.09.08
command: |
wget https://github.com/clj-kondo/clj-kondo/releases/download/v${CLJ_KONDO_VERSION}/clj-kondo-${CLJ_KONDO_VERSION}-linux-amd64.zip
unzip clj-kondo-${CLJ_KONDO_VERSION}-linux-amd64.zip
- run:
name: Lint source code
command: "./clj-kondo --lint src test"
test:
executor: clojure
steps:
- checkout
- restore_cache:
keys:
- v1-test-{{ checksum "project.clj" }}
- v1-test-
- run: lein deps
- save_cache:
key: v1-test-{{ checksum "project.clj" }}
paths:
- ~/.m2
- run: lein check
- run: lein test
integration:
executor: clojure
steps:
- checkout
- install-vault
- restore_cache:
keys:
- v1-test-{{ checksum "project.clj" }}
- v1-test-
- run: lein test :integration
coverage:
executor: clojure
steps:
- checkout
- install-vault
- restore_cache:
keys:
- v1-coverage-{{ checksum "project.clj" }}
- v1-coverage-
- v1-test-
- run:
name: Generate test coverage
command: lein with-profile +test cloverage --codecov
- save_cache:
paths:
- ~/.m2
key: v1-coverage-{{ checksum "project.clj" }}
- store_artifacts:
path: target/coverage
destination: coverage
- run:
name: Install codecov
command: |
sudo apt-get update && sudo apt-get install gpg
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
curl -Os https://uploader.codecov.io/latest/linux/codecov
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
shasum -a 256 -c codecov.SHA256SUM
chmod +x codecov
- run:
name: Publish coverage report
command: './codecov -f target/coverage/codecov.json'
# Workflow definitions
workflows:
version: 2
test:
jobs:
- style
- lint
- test
- integration
- coverage:
requires:
- test
- integration