Skip to content

Commit

Permalink
Include jest tests in GitHub action
Browse files Browse the repository at this point in the history
The parameter SARIF_ESLINT_IGNORE_SUPPRESSED in eslint.yml prevents
that errors that are disabled inline still show up on GitHub.
  • Loading branch information
BenediktSeidlSWM committed Jun 27, 2024
1 parent e271523 commit 4ad2e23
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,12 @@ jobs:
uses: actions/checkout@v3

- name: Install ESLint
run: |
npm install [email protected]
npm install @microsoft/[email protected]
npm install [email protected]
run: yarn install

- name: Run ESLint
run: npx eslint .
--config .eslintrc.js
--ext .js,.jsx,.ts,.tsx
env:
SARIF_ESLINT_IGNORE_SUPPRESSED: true
run: yarn lint
--format @microsoft/eslint-formatter-sarif
--output-file eslint-results.sarif
continue-on-error: true
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/jest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Jest

on:
push:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
- cron: '29 3 * * 5'

jobs:
eslint:
name: Run jest tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Jest
run: yarn install

- name: Run Jest
run: yarn test
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"@babel/preset-env": "^7.24.5",
"@babel/preset-react": "^7.24.1",
"@furkot/webfonts-generator": "^2.0.2",
"@microsoft/eslint-formatter-sarif": "^3.1.0",
"@testing-library/dom": "^10.1.0",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^16.0.0",
Expand Down

0 comments on commit 4ad2e23

Please sign in to comment.