-
Notifications
You must be signed in to change notification settings - Fork 15
130 lines (128 loc) · 3.81 KB
/
ci.yaml
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
123
124
125
126
127
128
129
130
name: "Continuous Integration"
on:
workflow_dispatch:
push:
branches:
- "feature/**"
- "fix/**"
- "release/v*.*.*"
- "dependabot/**"
env:
ACCESS_LOGGER: ${{ secrets.ACCESS_LOGGER }}
ALL_HEADERS: ${{ secrets.ALL_HEADERS }}
API_PREFIX: ${{ secrets.API_PREFIX }}
APP_ENV: ${{ secrets.APP_ENV }}
APP_VERSION: ${{ secrets.APP_VERSION }}
ASGI_LOGGER: ${{ secrets.ASGI_LOGGER }}
DOCS_URL: ${{ secrets.DOCS_URL }}
IS_ALLOWED_CREDENTIALS: ${{ secrets.IS_ALLOWED_CREDENTIALS }}
METHOD_1: ${{ secrets.METHOD_1 }}
METHOD_2: ${{ secrets.METHOD_2 }}
METHOD_3: ${{ secrets.METHOD_3 }}
METHOD_4: ${{ secrets.METHOD_4 }}
METHOD_5: ${{ secrets.METHOD_5 }}
OPENAPI_URL: ${{ secrets.OPENAPI_URL }}
REDOC_URL: ${{ secrets.REDOC_URL }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
SERVER_HOST: ${{ secrets.SERVER_HOST }}
SERVER_PORT: ${{ secrets.SERVER_PORT }}
SERVER_WORKERS: ${{ secrets.SERVER_WORKERS }}
jobs:
build:
strategy:
matrix:
os: ["ubuntu-22.04"]
python-version: ["3.12.0"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5.1.0
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install package and dependencies
run: |
python3 -m pip install --upgrade pip setuptools wheel
pip3 install .
code-quality:
needs: build
strategy:
matrix:
os: ["ubuntu-22.04"]
python-version: ["3.12.0"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5.1.0
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install linting dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip3 install ".[linter]"
- name: Lint with Black
working-directory: ./src
run: |
black --config=../pyproject.toml .
- name: Lint with Isort
working-directory: ./src
run: |
isort --settings-path=../pyproject.toml .
- name: Lint with MyPy
working-directory: ./src
run: |
mypy --config-file=../pyproject.toml --pretty .
security:
needs: code-quality
strategy:
matrix:
os: ["ubuntu-22.04"]
python-version: ["3.12.0"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5.1.0
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install testing dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip3 install ".[security]"
- name: Test application's vulnerability with bandit
working-directory: ./src
run: |
bandit -c ../pyproject.toml -r .
test:
needs: code-quality
strategy:
matrix:
os: ["ubuntu-22.04"]
python-version: ["3.12.0"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5.1.0
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install testing dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip3 install ".[test]"
- name: Test with Pytest and Coverage
run: |
pytest --cov --cov-report xml .
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.3.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
flags: pleno_rapid_assessment
name: codecov-umbrella
verbose: true