-
Notifications
You must be signed in to change notification settings - Fork 3
85 lines (75 loc) · 2.35 KB
/
python-app.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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python application
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install -r requirements/core.txt
pip install -r requirements/testing.txt
- name: Test with pytest
env:
MONGODB_PASSWORD: ${{secrets.MONGODB_PASSWORD}}
run: |
pytest
lint-and-format-backend:
continue-on-error: true
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
checks: write
contents: read
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Check Black formatting
uses: reviewdog/action-black@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
filter_mode: added
level: warning
- uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
if: always()
- name: Check Ruff linting (Reviewdog)
if: always()
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip3 install ruff
ruff check . \
| reviewdog -name=Ruff -reporter=local -reporter=github-pr-review -efm="%f:%l:%c: %m" -filter-mode=added -fail-on-error=false
- name: Check Mypy linting
if: always()
uses: tsuyoshicho/action-mypy@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
filter_mode: added
setup_command: pip3 install --no-cache-dir --upgrade -r requirements/all.txt
setup_method: install
level: warning
mypy_flags: --python-version 3.10