Skip to content

Commit 4ad2e23

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

File tree

3 files changed

+29
-7
lines changed

3 files changed

+29
-7
lines changed

.github/workflows/eslint.yml

+4-7
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,12 @@ jobs:
3131
uses: actions/checkout@v3
3232

3333
- name: Install ESLint
34-
run: |
35-
npm install [email protected]
36-
npm install @microsoft/[email protected]
37-
npm install [email protected]
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

.github/workflows/jest.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Jest
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [ "master" ]
9+
schedule:
10+
- cron: '29 3 * * 5'
11+
12+
jobs:
13+
eslint:
14+
name: Run jest tests
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
20+
- name: Install Jest
21+
run: yarn install
22+
23+
- name: Run Jest
24+
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)