forked from dequelabs/axe-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
95 lines (87 loc) · 2.27 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
version: 2
defaults: &defaults
docker:
- image: circleci/node:6.12.3-browsers
working_directory: ~/axe-core
restore_dependency_cache: &restore_dependency_cache
restore_cache:
keys:
- v1-npm-cache-{{ checksum "package.json" }}
- v1-npm-cache-
set_npm_auth: &set_npm_auth
run: npm config set "//registry.npmjs.org/:_authToken" $NPM_AUTH
jobs:
# Fetch and cache dependencies.
dependencies:
<<: *defaults
steps:
- checkout
- <<: *set_npm_auth
- <<: *restore_dependency_cache
- run: npm install
- save_cache:
key: v1-npm-cache-{{ checksum "package.json" }}
paths:
- node_modules
# Run the test suite.
test:
<<: *defaults
steps:
- checkout
- <<: *restore_dependency_cache
- run: npm run test
# Release a "next" version
next_release:
<<: *defaults
steps:
- checkout
- <<: *set_npm_auth
- <<: *restore_dependency_cache
- run: npm run next-release
- run: npm publish --tag=next
# Release a "production" version
production_release:
<<: *defaults
steps:
- checkout
- <<: *set_npm_auth
- <<: *restore_dependency_cache
- run: npm publish
workflows:
version: 2
build:
jobs:
- dependencies
# Run tests on all commits, but after installing dependencies
- test:
requires:
- dependencies
# Hold for approval
- hold:
type: approval
requires:
- test
filters:
# We only want to hold on these two branches, as PR review acts as approval for PRs
branches:
only:
- master
- develop
# Run a next release on "develop" commits, but only after the tests pass and dependencies are installed
- next_release:
requires:
- dependencies
- test
- hold
filters:
branches:
only: develop
# Run a production release on "master" commits, but only after the tests pass and dependencies are installed
- production_release:
requires:
- dependencies
- test
- hold
filters:
branches:
only: master