forked from openapi-generators/openapi-python-client
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (59 loc) · 2.08 KB
/
checks.yml
File metadata and controls
75 lines (59 loc) · 2.08 KB
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
name: Run Checks
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
test:
strategy:
matrix:
python: [ "3.7", "3.8", "3.9", "3.10" ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Get Python Version
id: get_python_version
run: echo "::set-output name=python_version::$(python --version)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: .venv
key: ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-dependencies-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-dependencies
- name: Install Poetry
run: pip install poetry
- name: Create Virtual Environment
run: python -m venv .venv
- name: Upgrade pip
run: poetry run python -m pip install --upgrade pip
- name: Install Dependencies
run: poetry install
- name: Run Black
run: poetry run black . --check
- name: Run isort
run: poetry run isort . --check
- name: Run flake8
run: poetry run flake8 openapi_python_client
- name: Run safety
run: poetry export -f requirements.txt | poetry run safety check --bare --stdin
- name: Run mypy
run: poetry run mypy --show-error-codes openapi_python_client
- name: Run pylint
run: poetry run pylint openapi_python_client
- name: Run pytest
run: poetry run pytest --cov=openapi_python_client --cov-report=term-missing tests end_to_end_tests/test_end_to_end.py --basetemp=tests/tmp
env:
TASKIPY: true
- name: Generate coverage report
shell: bash
run: poetry run coverage xml
- uses: codecov/codecov-action@v2
with:
files: ./coverage.xml