-
Notifications
You must be signed in to change notification settings - Fork 7
94 lines (74 loc) · 2.21 KB
/
test.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
name: Python application test with GitHub Actions
on:
push:
branches: [ trunk ]
pull_request:
branches: [ trunk ]
defaults:
run:
shell: bash
jobs:
unit_tests:
strategy:
matrix:
python-version: [ "3.9", "3.10", "3.11" ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup the Python Environment ${{ matrix.python-version }}
uses: Qwerty-133/python-setup@v1
with:
python-version: ${{ matrix.python-version }}
skip-pre-commit: true
- name: Install dependencies
run: |
poetry install --all-extras --with dev
- name: Run tests
run: |
poetry run pytest .
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
mypy:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.9", "3.10", "3.11" ]
steps:
- uses: actions/checkout@v3
- name: Setup the Python Environment ${{ matrix.python-version }}
uses: Qwerty-133/python-setup@v1
with:
python-version: ${{ matrix.python-version }}
skip-pre-commit: true
- name: Install dependencies
run: |
poetry install --all-extras --with dev,typecheck
- name: Validate type-hints with MyPy
run: |
poetry run mypy --ignore-missing-imports \
--follow-imports=skip \
--strict-optional \
-p pydantic_numpy
format:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.11" ]
steps:
- uses: actions/checkout@v3
- name: Setup the Python Environment ${{ matrix.python-version }}
uses: Qwerty-133/python-setup@v1
with:
python-version: ${{ matrix.python-version }}
skip-pre-commit: true
- name: Install dependencies
run: |
poetry install --all-extras --with format
- name: Check code formatting
run: |
poetry run black . --check --diff
poetry run isort . --check --diff
poetry run ruff check .