-
Notifications
You must be signed in to change notification settings - Fork 2k
/
config.yml
139 lines (128 loc) 路 4.45 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
134
135
136
137
138
139
version: 2.1
# These "CircleCI Orbs" are reusable bits of configuration that can be shared
# across projects. See https://circleci.com/orbs/ for more information.
orbs:
# `oss` is a local reference to the package. The source for Apollo Orbs can
# be found at http://github.com/apollographql/CircleCI-Orbs/.
# We could use Renovate to bump this version via PR, but that's not setup now.
oss: apollo/oss-ci-cd-tooling@0.0.16
commands:
# These are the steps used for each version of Node which we're testing
# against. Thanks to YAMLs inability to merge arrays (though it is able
# to merge objects), every version of Node must use the exact same steps,
# or these steps would need to be repeated in a version of Node that needs
# something different. Probably best to avoid that, out of principle, though.
common_test_steps:
description: "Commands to run on every Node.js environment"
steps:
- oss/install_specific_npm_version
- checkout
- oss/npm_clean_install_with_caching
- run:
command: npm run test:ci
environment:
JEST_JUNIT_OUTPUT_DIR: "reports/junit/"
- run: npm run coverage:upload
- store_test_results:
path: reports/junit
- store_artifacts:
path: reports/junit
# Important! When adding a new job to `jobs`, make sure to define when it
# executes by also adding it to the `workflows` section below!
jobs:
# Platform tests, each with the same tests but different platform or version.
# The docker tag represents the Node.js version and the full list is available
# at https://hub.docker.com/r/circleci/node/.
# NODE: Note certain tests are currently being skipped for Node.js 6.
# NodeJS 6:
# executor: { name: oss/node, tag: '6' }
# steps:
# - common_test_steps
NodeJS 8:
executor: { name: oss/node, tag: '8' }
steps:
- common_test_steps
NodeJS 10:
executor: { name: oss/node, tag: '10' }
steps:
- common_test_steps
# We will save the results of this one particular invocation to use in
# the publish step. Not only does this make the publishing step take less
# time, this also ensures that a passing version gets deployed even if,
# theoretically, rebuilding the same commit on the same version of
# Node.js should yield the same results!
- persist_to_workspace:
root: .
paths:
- ./**
NodeJS 12:
executor: { name: oss/node, tag: '12' }
steps:
- common_test_steps
NodeJS 14:
executor: { name: oss/node, tag: '14' }
steps:
- common_test_steps
# XXX We used to use this filter to only run a "Docs" job on docs branches.
# Now we use it to disable all jobs. It's unclear if there's a simpler way
# to do this!
common_non_publish_filters: &common_non_publish_filters
filters:
branches:
# If 'docs' is found, with word boundaries on either side, skip.
ignore: /.*?\bdocs\b.*/
# Ensure every job has `tags` filters since the publish steps have tags.
# This is some wild configuration thing that's pretty hard to figure out.
tags:
only: /.*/
common_publish_filters: &common_publish_filters
filters:
# Only run pre-publish and publish steps on specific tags.
tags:
only: /^publish\/[0-9]+$/
# We want the publish to trigger on the above tag, not any branch.
branches:
ignore: /.*/
workflows:
version: 2
Build:
jobs:
# - NodeJS 6:
# <<: *common_non_publish_filters
- NodeJS 8:
<<: *common_non_publish_filters
- NodeJS 10:
<<: *common_non_publish_filters
- NodeJS 12:
<<: *common_non_publish_filters
- NodeJS 14:
<<: *common_non_publish_filters
- oss/lerna_tarballs:
name: Package tarballs
<<: *common_non_publish_filters
requires:
# - NodeJS 6
- NodeJS 8
- NodeJS 10
- NodeJS 12
- NodeJS 14
- oss/dry_run:
name: Dry-run
<<: *common_publish_filters
requires:
# - NodeJS 6
- NodeJS 8
- NodeJS 10
- NodeJS 12
- NodeJS 14
- oss/confirmation:
name: Confirmation
type: approval
<<: *common_publish_filters
requires:
- Dry-run
- oss/publish:
name: Publish
<<: *common_publish_filters
requires:
- Confirmation