From 4ad2e232866b451d341129e69b877d563228d2a6 Mon Sep 17 00:00:00 2001 From: Benedikt Seidl Date: Wed, 19 Jun 2024 12:39:09 +0200 Subject: [PATCH] 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. --- .github/workflows/eslint.yml | 11 ++++------- .github/workflows/jest.yml | 24 ++++++++++++++++++++++++ package.json | 1 + 3 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/jest.yml diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 1a9ebde1f..bf0928dff 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -31,15 +31,12 @@ jobs: uses: actions/checkout@v3 - name: Install ESLint - run: | - npm install eslint@8.56.0 - npm install @microsoft/eslint-formatter-sarif@3.0.0 - npm install eslint-plugin-react@7.33.2 + 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 diff --git a/.github/workflows/jest.yml b/.github/workflows/jest.yml new file mode 100644 index 000000000..c15f1369e --- /dev/null +++ b/.github/workflows/jest.yml @@ -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 diff --git a/package.json b/package.json index 1a7f6c760..20d5bb6c0 100644 --- a/package.json +++ b/package.json @@ -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",