-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathconfig.yml
More file actions
110 lines (97 loc) · 2.74 KB
/
config.yml
File metadata and controls
110 lines (97 loc) · 2.74 KB
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
version: 2.1
supported-jest-versions: &supported-jest-versions ["local", "28", "29"]
deploy_filters: &deploy_filters
filters:
branches:
ignore: /.*/
tags:
# Trigger on tags that begin with `v`
only: /^v.*/
executors:
node:
working_directory: ~/lwc-test
docker:
- image: cimg/node:24.11.0
commands:
save_yarn_cache:
description: Save Yarn cache for future build
steps:
- save_cache:
key: yarn-v5-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
restore_yarn_cache:
description: Restore Yarn cache from previous build
steps:
- restore_cache:
keys:
- yarn-v5-{{ checksum "yarn.lock" }}
jobs:
build:
parameters:
jest-version:
type: string
description: >
Overrides the installed version of jest. When set to "local" the version of jest set
frozen in the yarn.lock is used.
default: "local"
executor: node
steps:
- checkout
- restore_yarn_cache
- run:
name: Install dependencies and build
command: yarn install --frozen-lockfile
- save_yarn_cache
- when:
condition:
not:
equal: [<<parameters.jest-version>>, "local"]
steps:
- run:
name: Override version of jest@<<parameters.jest-version>> and jest-environment-jsdom@<<parameters.jest-version>>
command: |
yarn remove jest jest-environment-jsdom -W --dev
yarn add jest@<<parameters.jest-version>> -W --dev
yarn add jest-environment-jsdom@<<parameters.jest-version>> -W --dev
- run:
name: Run linter
command: yarn lint
- run:
name: Check format
command: yarn format:check
- run:
name: Run unit tests
command: yarn test --runInBand
deploy:
executor: node
steps:
- checkout
- restore_yarn_cache
- run:
name: Install dependencies and build
command: yarn install --frozen-lockfile
- run:
name: Configure NPM authentication
command: npm config set "//registry.npmjs.org/:_authToken" "$NPM_AUTOMATION_TOKEN"
- run:
name: Publish package
command: yarn release:publish:ci
workflows:
build_and_test:
jobs:
- build:
matrix:
parameters:
jest-version: *supported-jest-versions
build_and_test_and_deploy:
jobs:
- build:
<<: *deploy_filters
matrix:
parameters:
jest-version: *supported-jest-versions
- deploy:
<<: *deploy_filters
requires:
- build