This repository has been archived by the owner on Oct 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
122 lines (104 loc) · 3.43 KB
/
run-checks.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Run Checks
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
check-backend:
name: Check Backend
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: "pip"
cache-dependency-path: |
requirements.txt
requirements-dev.txt
- name: Install xmlsec dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libxml2-dev libxmlsec1-dev libxmlsec1-openssl
version: 1.0
- name: Install Python dependencies
run: pip install -r requirements.txt -r requirements-dev.txt
- name: Format with Black
uses: reviewdog/action-black@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
level: warning
reporter: github-pr-review
- name: Lint with flake8
uses: reviewdog/action-flake8@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
level: warning
reporter: github-pr-review
- name: Cache `.mypy_cache`
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.mypy_cache
key: ${{ runner.os }}-python3.9-mypy-cache
- name: Lint with mypy
uses: tsuyoshicho/action-mypy@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
level: error
reporter: github-pr-review
- name: Run tests with pytest
run: pytest
# uses: reviewdog/action-pytest@v1 (WIP)
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# reporter: github-pr-review
# level: error
check-frontend:
name: Check Frontend
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: "npm"
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }}
- name: Install frontend dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
- name: Format with Prettier
uses: EPMatt/reviewdog-action-prettier@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
level: warning
reporter: github-pr-review
prettier_flags: src
- name: Lint with ESLint
uses: reviewdog/action-eslint@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
level: error
reporter: github-pr-review
eslint_flags: "src/"
- name: Cache Next.js build
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}
- name: Check can build
run: npm run build