Skip to content
This repository was archived by the owner on Apr 8, 2026. It is now read-only.

Commit 8824fea

Browse files
committed
feat: snykify
1 parent df254e3 commit 8824fea

15 files changed

Lines changed: 44 additions & 698 deletions

File tree

.circleci/config.yml

Lines changed: 27 additions & 204 deletions
Original file line numberDiff line numberDiff line change
@@ -1,228 +1,51 @@
1-
version: 2
2-
3-
defaults: &defaults
4-
docker:
5-
- image: circleci/node:14.4.0
1+
version: 2.1
62

73
jobs:
8-
dependencies:
9-
<<: *defaults
4+
test:
5+
docker:
6+
- image: cimg/node:14.19
7+
working_directory: ~/lib
108
steps:
119
- checkout
12-
- restore_cache:
13-
key: dependency-cache-{{ checksum "package-lock.json" }}
1410
- run:
15-
name: Npm Install
11+
name: Install
1612
command: npm install
17-
- save_cache:
18-
key: dependency-cache-{{ checksum "package-lock.json" }}
19-
paths:
20-
- node_modules
21-
- persist_to_workspace:
22-
root: .
23-
paths:
24-
- node_modules/
25-
26-
lint:
27-
<<: *defaults
28-
steps:
29-
- checkout
30-
- attach_workspace:
31-
at: .
3213
- run:
3314
name: Lint
3415
command: npm run lint
35-
36-
build:
37-
<<: *defaults
38-
steps:
39-
- checkout
40-
- attach_workspace:
41-
at: .
42-
- run: npm run build
43-
- persist_to_workspace:
44-
root: .
45-
paths:
46-
- dist/
47-
48-
test_pre:
49-
<<: *defaults
50-
steps:
51-
- attach_workspace:
52-
at: .
53-
- run:
54-
name: Download cc-test-reporter
55-
command: |
56-
mkdir -p tmp/
57-
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./tmp/cc-test-reporter
58-
chmod +x ./tmp/cc-test-reporter
59-
- persist_to_workspace:
60-
root: .
61-
paths:
62-
- tmp/cc-test-reporter
63-
64-
test_post:
65-
<<: *defaults
66-
steps:
67-
- attach_workspace:
68-
at: .
69-
- run:
70-
name: Upload coverage results to Code Climate
71-
command: |
72-
tmp/cc-test-reporter sum-coverage tmp/coverage/codeclimate.*.json -p 1 -o tmp/coverage/codeclimate.total.json
73-
CC_TEST_REPORTER_ID=$CODE_CLIMATE_REPORTER_ID tmp/cc-test-reporter upload-coverage -i tmp/coverage/codeclimate.total.json
74-
75-
test_unit:
76-
<<: *defaults
77-
steps:
78-
- checkout
79-
- attach_workspace:
80-
at: .
81-
- run:
82-
name: Unit Tests
83-
command: |
84-
npm run test:unit:coverage
85-
- run:
86-
name: Code Climate Coverage
87-
command: |
88-
ls
89-
ls tmp/
90-
tmp/cc-test-reporter format-coverage -t lcov -o tmp/coverage/codeclimate.unit.json tests/reports/unit/coverage/lcov.info
91-
- store_artifacts:
92-
path: tests/reports/unit/junit.xml
93-
prefix: tests
94-
- store_artifacts:
95-
path: tests/reports/unit/coverage
96-
prefix: coverage
97-
- store_test_results:
98-
path: tests/reports/unit
99-
- persist_to_workspace:
100-
root: .
101-
paths:
102-
- tmp/coverage
103-
# - run:
104-
# name: Coveralls
105-
# command: export COVERALLS_GIT_COMMIT=$CIRCLE_SHA1 && npm run coveralls < tests/reports/unit/coverage/lcov.info
106-
107-
test_int: #TODO - multiple node envs
108-
<<: *defaults
109-
steps:
110-
- checkout
111-
- attach_workspace:
112-
at: .
11316
- run:
114-
name: Integrations Tests
115-
command: npm run test:int
116-
- store_artifacts:
117-
path: tests/reports/int/junit.xml
118-
prefix: tests
119-
- store_test_results:
120-
path: tests/reports/int
121-
17+
name: Test
18+
command: npm run test
12219
release:
123-
<<: *defaults
20+
docker:
21+
- image: cimg/node:14.19
22+
working_directory: ~/lib
12423
steps:
12524
- checkout
126-
- attach_workspace:
127-
at: .
12825
- run:
129-
name: Authenticate with registry
130-
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ./.npmrc
26+
name: Install
27+
command: npm install
13128
- run:
132-
name: Publish package
133-
command: npm publish
29+
name: Release
30+
command: npx semantic-release@17
13431

13532
workflows:
13633
version: 2
137-
build_and_test:
138-
jobs:
139-
- dependencies
140-
- lint:
141-
requires:
142-
- dependencies
143-
- build:
144-
requires:
145-
- lint
146-
- test_pre
147-
- test_unit:
148-
requires:
149-
- lint
150-
- test_pre
151-
152-
- test_int:
153-
requires:
154-
- build
155-
- test_pre
156-
- test_post:
157-
requires:
158-
- test_unit
159-
- test_int
160-
161-
release:
34+
test:
16235
jobs:
163-
- dependencies:
36+
- test:
37+
name: Test
38+
context: nodejs-install
16439
filters:
165-
tags:
166-
only: /^v.*/
16740
branches:
168-
ignore: /.*/
169-
- lint:
170-
requires:
171-
- dependencies
172-
filters:
173-
tags:
174-
only: /^v.*/
175-
branches:
176-
ignore: /.*/
177-
- test_pre:
178-
filters:
179-
tags:
180-
only: /^v.*/
181-
branches:
182-
ignore: /.*/
183-
- test_unit:
184-
requires:
185-
- lint
186-
- test_pre
187-
filters:
188-
tags:
189-
only: /^v.*/
190-
branches:
191-
ignore: /.*/
192-
- build:
193-
requires:
194-
- lint
195-
filters:
196-
tags:
197-
only: /^v.*/
198-
branches:
199-
ignore: /.*/
200-
- test_int:
201-
requires:
202-
- build
203-
- test_pre
204-
filters:
205-
tags:
206-
only: /^v.*/
207-
branches:
208-
ignore: /.*/
209-
- test_post:
210-
requires:
211-
- test_unit
212-
- test_int
213-
filters:
214-
tags:
215-
only: /^v.*/
216-
branches:
217-
ignore: /.*/
41+
ignore:
42+
- main
43+
release:
44+
jobs:
21845
- release:
219-
requires:
220-
- test_unit
221-
- test_int
222-
- build
46+
name: Release
47+
context: nodejs-lib-release
22348
filters:
224-
tags:
225-
only: /^v.*/
22649
branches:
227-
ignore: /.*/
228-
50+
only:
51+
- main

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
src/ @jjmschofield
1+
* @snyk/arch

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,4 @@ fabric.properties
7171
# Android studio 3.1+ serialized cache file
7272
.idea/caches/build_file_checksums.ser
7373
/junit.xml
74+
.idea/

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.idea/github-codeowners.iml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.idea/jsLibraryMappings.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.idea/misc.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.idea/modules.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.idea/runConfigurations/test_int.xml

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)