-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (83 loc) · 2.77 KB
/
django.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: Django CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
tests:
name: tests-python${{ matrix.python-version }}-${{ matrix.os }}
env:
APP_KEY: ${{secrets.APP_KEY}}
APP_SECRET: ${{secrets.APP_SECRET}}
REFRESH_TOKEN: ${{secrets.REFRESH_TOKEN}}
SECRET_KEY: ${{secrets.SECRET_KEY}}
USERNAME_TEST: ${{secrets.USERNAME_TEST}}
PASSWORD_TEST: ${{secrets.PASSWORD_TEST}}
BASE_URL: ${{secrets.BASE_URL}}
MONGODB_USERNAME: ${{secrets.MONGODB_USERNAME}}
MONGODB_PASSWORD: ${{secrets.MONGODB_PASSWORD}}
MONGODB_DATABASE_URL: ${{secrets.MONGODB_DATABASE_URL}}
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ["3.10", "3.12"]
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
steps:
- name: Print Concurrency Group
env:
CONCURRENCY_GROUP: ${{ github.repository }}-${{ github.ref }}-${{ github.head_ref }}
run: |
echo -e "\033[31;1;4mConcurrency Group\033[0m"
echo -e "$CONCURRENCY_GROUP\n"
shell: bash
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
pipx install poetry
poetry install
- name: Run Tests
run: |
poetry run runtests
lint:
env:
APP_KEY: ${{secrets.APP_KEY}}
APP_SECRET: ${{secrets.APP_SECRET}}
REFRESH_TOKEN: ${{secrets.REFRESH_TOKEN}}
SECRET_KEY: ${{secrets.SECRET_KEY}}
USERNAME_TEST: ${{secrets.USERNAME_TEST}}
PASSWORD_TEST: ${{secrets.PASSWORD_TEST}}
BASE_URL: ${{secrets.BASE_URL}}
MONGODB_USERNAME: ${{secrets.MONGODB_USERNAME}}
MONGODB_PASSWORD: ${{secrets.MONGODB_PASSWORD}}
MONGODB_DATABASE_URL: ${{secrets.MONGODB_DATABASE_URL}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Dependencies
run: |
pipx install poetry
poetry install
- name: Run pylint
run: |
export PYTHONPATH=$PYTHONPATH:$PWD
poetry run pylint --load-plugins pylint_django --django-settings-module=tests.test_settings src
poetry run pylint --load-plugins pylint_django --django-settings-module=tests.test_settings tests
poetry run pylint runtests.py
- name: Run black
run: |
poetry run black --check .
- name: Run mypy
run: |
poetry run mypy src
poetry run mypy tests
poetry run mypy runtests.py