-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.yml
67 lines (62 loc) · 1.61 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
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
version: 2
defaults: &defaults
working_directory: ~/repo
docker:
- image: cimg/node:lts
jobs:
test:
<<: *defaults
steps:
- checkout
- run:
name: Install dependencies
command: npm ci
- run:
name: Build package
command: npm run build
- run:
name: Install JUnit coverage reporter
command: npm i -D jest-junit
- run:
name: Run tests
command: |
npx jest --listTests | circleci tests run --command="JEST_JUNIT_ADD_FILE_ATTRIBUTE=true xargs npx jest --config jest.config.ts --runInBand --reporters=default --reporters=jest-junit --" --verbose --split-by=timings
environment:
JEST_JUNIT_OUTPUT_DIR: ./reports/
JEST_JUNIT_ADD_FILE_ATTRIBUTE: "true"
- store_test_results:
path: ./reports/
- persist_to_workspace:
root: ~/repo
paths:
- .
deploy:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run:
name: Publish to NPM
command: |
npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN
npm publish
workflows:
version: 2
npm-deploy:
jobs:
- test:
filters:
tags:
only: /.*/
- deploy:
context: reachfive
requires:
- test
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/