-
Notifications
You must be signed in to change notification settings - Fork 64
79 lines (70 loc) · 2.19 KB
/
code-style.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
name: Code style
on:
workflow_dispatch:
pull_request:
jobs:
backend:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- tool: black
arguments: --check src/backend/
working_directory: .
- tool: mypy
arguments: --namespace-packages --package backend --install-types --non-interactive --ignore-missing-imports --exclude migrations/
working_directory: ./src
- tool: flake8
arguments: --ignore=E203,E501,W503,W605 src/backend
working_directory: .
name: ${{ matrix.tool }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Python dependencies
run: |
python -m pip install -U pip
python -m pip install -r src/backend/requirements-dev.txt
- uses: dorny/paths-filter@3c49e64ca26115121162fb767bc6af9e8d059f1a
id: changes
with:
filters: |
backend:
- 'src/backend/**'
- name: Check
working-directory: ${{ matrix.working_directory }}
if: ${{ steps.changes.outputs.backend == 'true' || github.event_name != 'pull_request' }}
run: ${{ matrix.tool }} ${{ matrix.arguments }}
frontend:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- script: eslint
- script: prettier
name: ${{ matrix.script }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install NPM dependencies
working-directory: src/frontend
run: npm install .
- uses: dorny/paths-filter@3c49e64ca26115121162fb767bc6af9e8d059f1a
id: changes
with:
filters: |
frontend:
- 'src/frontend/**'
- name: Check
working-directory: src/frontend/
if: ${{ steps.changes.outputs.frontend == 'true' || github.event_name != 'pull_request' }}
run: npm run ${{ matrix.script }}