generated from open-source-uc/osuc-template
-
Notifications
You must be signed in to change notification settings - Fork 5
93 lines (74 loc) · 1.96 KB
/
lint.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
89
90
91
92
93
name: Lint and test
on:
push:
branches:
- main
pull_request:
permissions:
checks: write
contents: write
jobs:
check-backend:
name: Run test and linters for the back-end
runs-on: ubuntu-latest
timeout-minutes: 5
defaults:
run:
shell: bash
working-directory: backend
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Install Poetry
run: pipx install poetry
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: "poetry"
- name: Install dependencies
run: |
poetry install
poetry run prisma generate
- name: Run ruff formatter
uses: chartboost/ruff-action@v1
with:
args: "format --diff"
src: "./backend"
- name: Run ruff
uses: chartboost/ruff-action@v1
with:
src: "./backend"
- name: Run type checker
run: poetry run pyright .
- name: Run pytest
run: poetry run pytest
lint-frontend:
name: Run linters for the front-end
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: frontend
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Set up Node.js 16
uses: actions/setup-node@v3
with:
node-version: "16"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run linters
uses: wearerequired/lint-action@v2
with:
github_token: ${{ secrets.github_token }}
auto_fix: ${{ github.event_name == 'pull_request' }}
eslint: true
eslint_dir: frontend
eslint_extensions: ts,tsx,js,jsx
eslint_auto_fix: true
- name: Run type checker
run: npm run type-check