-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (55 loc) · 1.74 KB
/
ci.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
name: CI
on:
push:
pull_request:
branches:
- main
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout Code Repo
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.10.4'
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.6.1
virtualenvs-create: false
- name: Install Dependencies
run: poetry install --no-root --no-interaction
- name: Style Check (black)
run: poetry run black gcmanager/ tests/ --check --verbose --diff --color
- name: Imports Sorting Check (isort)
run: poetry run isort gcmanager/ tests/ --check --diff
- name: Type Check (mypy)
run: poetry run mypy
- name: Lint Check (Ruff)
run: poetry run ruff gcmanager/ tests/
- name: Common Security Checks (bandit)
run: poetry run bandit -r gcmanager --verbose
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: '5.0.6'
mongodb-username: testing_user
mongodb-password: testing
mongodb-port: 27020
- name: Testing
run: |
poetry run coverage erase
poetry run coverage run -mp unittest discover tests/unit --verbose
poetry run coverage run -mp unittest discover tests/integration --verbose
poetry run coverage combine
- name: Coverage
run: |
poetry run coverage report
poetry run coverage xml
- name: Upload Coverage Report to CodeCov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
verbose: true