-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
125 lines (122 loc) · 3.43 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
parameters:
jabba:
version: &jabba_version 0.7.0
cache_key: &jabba_cache_key v1-jabba-0.7.0
java:
version: &java_version [email protected]
allure:
version: &allure_version 2.3.3
cache_key: &allure_cache_key v1-allure-2.3.3
npm:
cache_key: &npm_cache_key v1-npm-{{ checksum "package.json" }}
docker:
image: &docker_image circleci/node:4.8
version: 2
jobs:
build:
working_directory: /tmp/workspace
docker:
- image: *docker_image
environment:
JABBA_VERSION: *jabba_version
JAVA_VERSION: *java_version
ALLURE_VERSION: *allure_version
steps:
- checkout
- restore-cache:
key: *npm_cache_key
- restore-cache:
key: *jabba_cache_key
- restore-cache:
key: *allure_cache_key
- run:
name: 'Setup: Install Dependencies'
command: |
npm install
sudo ln -sf /tmp/workspace/node_modules/.bin/jake /usr/local/bin/jake
when: always
- type: save-cache
key: *npm_cache_key
paths:
- node_modules
- run:
name: 'Setup: Install Jabba & Java'
command: |
set -euxo pipefail
sudo ln -sf ~/.jabba/bin/jabba /usr/local/bin/jabba
[ ! -d ~/.jabba ] || exit 0
curl -sL https://github.com/shyiko/jabba/raw/master/install.sh | bash && . ~/.jabba/jabba.sh
jabba install $JAVA_VERSION
when: always
- type: save-cache
key: *jabba_cache_key
paths:
- ~/.jabba
- run:
name: 'Setup: Install Allure'
command: |
set -euxo pipefail
sudo ln -sf ~/allure/bin/allure /usr/local/bin/allure
[ ! $(which allure) ] || exit 0
curl -L "https://dl.bintray.com/qameta/generic/io/qameta/allure/allure/$ALLURE_VERSION/allure-$ALLURE_VERSION.zip" > /tmp/allure.zip
unzip /tmp/allure.zip -d /tmp/allure
mkdir -p ~/allure
sudo mv /tmp/allure/*/* ~/allure
- type: save-cache
key: *allure_cache_key
paths:
- ~/allure
- run:
name: 'Validation: Lint'
command: jake lint
- run:
name: 'Validation: Test'
command: jake test:coverage
when: always
- run:
name: 'Report: Generate'
command: |
export JAVA_HOME="$(jabba which $JAVA_VERSION)"
jake test:report
when: always
- run:
name: 'Report: Publish'
command: jake test:report:publish
when: always
- type: store-artifacts
path: tmp/metadata
destination: metadata
when: always
- type: store-artifacts
path: tmp/report
destination: report
when: always
- store_test_results:
path: tmp/metadata/junit
publish:
working_directory: /tmp/workspace
docker:
- image: *docker_image
steps:
- checkout
- run:
command: echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > ~/.npmrc
- run:
command: npm publish --access public
workflows:
version: 2
default:
jobs:
- build:
filters:
tags:
only: /.*/
- publish:
context: org-global
requires:
- build
filters:
tags:
only: /\d+\.\d+\.\d+/
branches:
ignore: /.*/