forked from electricitymaps/electricitymaps-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (59 loc) · 1.88 KB
/
eslint.yml
File metadata and controls
61 lines (59 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: ESLint
on:
workflow_call:
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@v4
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: './web/.node-version'
- 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