-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (64 loc) · 1.67 KB
/
test.yaml
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
62
63
64
65
66
67
68
69
name: Test
on:
push:
paths:
- '**/*.js'
- 'package.json'
- 'package-lock.json'
- '.eslintrc.json'
workflow_dispatch:
inputs:
autofix:
description: 'Autofix by ESLint'
required: false
type: boolean
jobs:
eslint:
name: ESLint
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
- name: Install dependencies
run: npm install
- name: Run ESLint
if: ${{ !inputs.autofix }}
run: npm run lint
- name: Run ESLint (autofix)
id: eslint_autofix
if: ${{ inputs.autofix }}
run: npm run lint:fix
continue-on-error: true
- name: Push to GitHub
if: ${{ inputs.autofix }}
uses: EndBug/[email protected]
with:
author_name: 'GitHub Actions'
author_email: '[email protected]'
message: |
:art: Autofix by ESLint
Co-authored-by: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
- name: Post Run ESLint (autofix)
if: ${{ steps.eslint_autofix.outcome == 'failure' }}
run: exit 1
tsc:
name: Type Check
runs-on: ubuntu-latest
if: ${{ !inputs.autofix }}
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
- name: Install dependencies
run: npm install
- name: Run tsc
run: npm run test