Skip to content

ESLint

ESLint #34

Workflow file for this run

name: ESLint
on:
workflow_call:
schedule:
- cron: '0 7 * * 1'
jobs:
eslint:
name: Check
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
timeout-minutes: 4
defaults:
run:
working-directory: web
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: 7
- name: Setup Node v18.x
uses: actions/setup-node@v3
with:
node-version: 18
- name: Restore node_modules for web
id: cache-web
uses: actions/cache@v3
with:
path: ./web/node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('./web/pnpm-lock.yaml') }}
- name: Install web dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pnpm install --frozen-lockfile
- name: Generate config files
if: steps.cache.outputs.cache-hit == 'true'
run: pnpm create-generated-files
- name: Restore ESLint cache
uses: actions/cache@v3
with:
path: ./web/node_modules/.cache/eslint/.eslintcache
key: ${{ runner.os }}-eslint_cache-${{ github.ref_name }}-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-eslint_cache-${{ github.ref_name }}
${{ runner.os }}-eslint_cache-master
- name: ESLint
run: node_modules/.bin/eslint .
--ignore-path .gitignore
--ext .ts,.tsx .
--cache
--cache-location node_modules/.cache/eslint/.eslintcache
--format @microsoft/eslint-formatter-sarif
--output-file eslint-results.sarif
continue-on-error: true
- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: web/eslint-results.sarif
wait-for-processing: true