Skip to content

Commit 783b6fe

Browse files
committed
adds codecov for js
1 parent 91ec4a5 commit 783b6fe

File tree

3 files changed

+36
-25
lines changed

3 files changed

+36
-25
lines changed

.github/workflows/js.yml

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,42 @@
11
name: JS lint & test
22
on:
3-
push:
4-
branches-ignore:
5-
- 'main-built'
3+
push:
4+
branches-ignore:
5+
- 'main-built'
66

77
jobs:
8-
js-lint-test:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- uses: actions/checkout@v4
8+
js-lint-test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
1212

13-
- name: Setup Node
14-
uses: actions/setup-node@v4
15-
with:
16-
node-version: 20.11
17-
cache: 'yarn'
13+
- name: Setup Node
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: 20.11
17+
cache: 'yarn'
1818

19-
- name: Install packages
20-
run: yarn install --immutable
19+
- name: Install packages
20+
run: yarn install --immutable
2121

22-
- name: JS lint
23-
run: yarn lint:js
22+
- name: JS lint
23+
run: yarn lint:js
2424

25-
- name: JS test
26-
run: yarn test:js
25+
- name: JS test
26+
run: yarn test:js
2727

28-
- name: Upload artifacts
29-
uses: actions/upload-artifact@v4
30-
if: always()
31-
with:
32-
name: js-report
33-
path: js-report/
34-
retention-days: 30
28+
- name: JS unit test coverage report
29+
uses: codecov/codecov-action@v4
30+
with:
31+
flags: jstests
32+
name: codecov-jsunit
33+
verbose: true
34+
token: ${{ secrets.CODECOV_TOKEN }}
35+
36+
- name: Upload artifacts
37+
uses: actions/upload-artifact@v4
38+
if: always()
39+
with:
40+
name: js-report
41+
path: js-report/
42+
retention-days: 30

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ build-script.sh
1818
integration-coverage.xml
1919
unit-coverage.xml
2020
.idea/
21+
/coverage/

jest.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ module.exports = {
66
modulePathIgnorePatterns: ['<rootDir>/vendor/'],
77
testEnvironment: 'jsdom',
88
testPathIgnorePatterns: ['<rootDir>/tests/e2e/'],
9+
collectCoverage: true,
10+
coverageReporters: ['text', 'cobertura'],
911
};

0 commit comments

Comments
 (0)