-
-
Notifications
You must be signed in to change notification settings - Fork 37
88 lines (74 loc) · 2.4 KB
/
linters.yml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: 😵💫 Sanity checks
on:
pull_request:
types: [opened, synchronize]
push:
branches:
- main
permissions:
pull-requests: write
jobs:
test:
name: 🧪 Tests
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v2
- name: 🏗 Setup Node
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: yarn
- name: 📦 Install dependencies
run: yarn install
- name: 🧪 Run tests
run: yarn run test
typecheck:
name: 🤓 Type checker
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v2
- name: 🏗 Setup Node
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: yarn
- name: 📦 Install dependencies
run: yarn install
- name: 🤓 Run type checker
run: yarn run typecheck
lint:
name: 👮♂️ Linters and formatters
runs-on: ubuntu-latest
permissions:
checks: write # Allow creating checks
contents: read
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v2
- name: 🏗 Setup Node
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: yarn
- name: 📦 Install dependencies
run: yarn install
- name: 👮♂️ Run linters
run: yarn run lint
- name: 💅 Run fixers, and check diff
id: diffCheck
run: yarn run fix && git diff --exit-code -- ':!yarn.lock'
- name: 💬 Post a check explaining the issue
if: ${{ failure() && steps.diffCheck.conclusion == 'failure' }}
uses: LouisBrunner/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: 🧹 Check all files are formatted correctly
conclusion: failure
output: |
{"summary": "Hrm, seems like you don't have prettier set up properly. Make sure your editor is configured to format code automatically, and that it respects the project's prettier config. [Click here](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) to view the Prettier extension for VS Code.\n\n> _**💡 Tip:**_ \n> \n> In the meantime you can run `npm run fix` and commit the changes."}