Skip to content

Commit d5bc966

Browse files
Include jest tests in GitHub action
The parameter SARIF_ESLINT_IGNORE_SUPPRESSED prevents that errors that are disabled inline still show up on GitHub.
1 parent e271523 commit d5bc966

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

.github/workflows/eslint.yml .github/workflows/ci.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# More details at https://github.com/eslint/eslint
88
# and https://eslint.org
99

10-
name: ESLint
10+
name: Continuous Integration
1111

1212
on:
1313
push:
@@ -19,8 +19,8 @@ on:
1919
- cron: '29 3 * * 5'
2020

2121
jobs:
22-
eslint:
23-
name: Run eslint scanning
22+
ci:
23+
name: Run code scanning and tests
2424
runs-on: ubuntu-latest
2525
permissions:
2626
contents: read
@@ -30,16 +30,13 @@ jobs:
3030
- name: Checkout code
3131
uses: actions/checkout@v3
3232

33-
- name: Install ESLint
34-
run: |
35-
npm install [email protected]
36-
npm install @microsoft/[email protected]
37-
npm install [email protected]
33+
- name: Install dependencies
34+
run: yarn install
3835

3936
- name: Run ESLint
40-
run: npx eslint .
41-
--config .eslintrc.js
42-
--ext .js,.jsx,.ts,.tsx
37+
env:
38+
SARIF_ESLINT_IGNORE_SUPPRESSED: true
39+
run: yarn lint
4340
--format @microsoft/eslint-formatter-sarif
4441
--output-file eslint-results.sarif
4542
continue-on-error: true
@@ -49,3 +46,6 @@ jobs:
4946
with:
5047
sarif_file: eslint-results.sarif
5148
wait-for-processing: true
49+
50+
- name: Run Jest
51+
run: yarn test

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
"@babel/preset-env": "^7.24.5",
7474
"@babel/preset-react": "^7.24.1",
7575
"@furkot/webfonts-generator": "^2.0.2",
76+
"@microsoft/eslint-formatter-sarif": "^3.1.0",
7677
"@testing-library/dom": "^10.1.0",
7778
"@testing-library/jest-dom": "^6.4.6",
7879
"@testing-library/react": "^16.0.0",

0 commit comments

Comments
 (0)