Update README.md #556
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
pull_request: | |
branches: [ '*' ] | |
jobs: | |
test: | |
name: Run Tests | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: write | |
checks: write | |
pull-requests: write | |
security-events: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
cache: 'yarn' | |
- name: Install node modules | |
run: | | |
yarn install --immutable --check-cache | |
- name: Run ESLint | |
continue-on-error: true | |
id: eslint | |
run: | | |
yarn lint --max-warnings=0 --format @microsoft/eslint-formatter-sarif --output-file eslint-results.sarif | |
- name: Upload ESLint analysis results to GitHub | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: eslint-results.sarif | |
wait-for-processing: true | |
- name: Run tests | |
# only if it is not a fork | |
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} | |
uses: willcaul/jest-github-action@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
test-command: "yarn test" | |
- name: Run tests (no report) | |
# only if it is not a fork | |
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} | |
run: yarn test | |
- name: Fail if ESLint errors | |
if: steps.eslint.outcome == 'failure' | |
run: exit 1 |