-
-
Notifications
You must be signed in to change notification settings - Fork 310
146 lines (144 loc) · 4.73 KB
/
test.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
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: Test on Python ${{ matrix.python-version }} and ${{ matrix.os }} and isort ${{ matrix.isort-version }} and pydantic ${{ matrix.pydantic-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest, windows-latest, macos-latest]
isort-version: [default]
black-version: [default]
pydantic-version: [1.10.9, 2.10.3]
include:
- os: ubuntu-latest
isort-version: 4.3.21
black-version: default
python-version: 3.8
pydantic-version: 1.5.1
- os: ubuntu-latest
isort-version: 5.6.4
black-version: default
python-version: 3.8
pydantic-version: 1.8.2
- os: ubuntu-latest
isort-version: 5.6.4
black-version: 19.10b0
python-version: 3.9
pydantic-version: 1.8.2
- os: ubuntu-latest
isort-version: 5.6.4
black-version: 24.1.0
python-version: 3.12
pydantic-version: 2.4.2
- os: ubuntu-latest
isort-version: 5.6.4
black-version: 23.12.1
python-version: 3.12
pydantic-version: 2.4.2
- os: ubuntu-latest
isort-version: 5.6.4
black-version: 22.1.0
python-version: 3.12
pydantic-version: 2.4.2
exclude:
- os: windows-latest
black-version: 22.1.0
- os: macos-latest
black-version: 22.1.0
- os: windows-latest
pydantic-version: 1.10.9
- os: macos-latest
pydantic-version: 1.10.9
- os: windows-latest
python-version: 3.8
- os: macos-latest
python-version: 3.8
- os: windows-latest
python-version: 3.9
- os: macos-latest
python-version: 3.9
- os: windows-latest
python-version: 3.10
- os: macos-latest
python-version: 3.10
- os: windows-latest
python-version: 3.11
- os: macos-latest
python-version: 3.11
- os: windows-latest
python-version: 3.12
- os: macos-latest
python-version: 3.12
- os: macos-latest
isort-version: 4.3.21
- isort-version: 5.6.4
pydantic-version: 1.10.9
defaults:
run:
shell: bash
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
ISORT: ${{ matrix.isort-version }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.7.1
virtualenvs-path: .venv
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
if: matrix.os != 'windows-latest'
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pydantic-version }}-v1-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction -E http -E graphql
- name: Install isort ${{ matrix.isort-version }} for Linux/macOS
if: "runner.os != 'Windows' && matrix.isort-version != 'default'"
run: |
poetry run pip install isort==${{ matrix.isort-version }}
- name: Install Pydantic ${{ matrix.pydantic-version }}
if: matrix.pydantic-version != 'default'
run: |
poetry run pip install pydantic=="${{ matrix.pydantic-version }}"
- name: Install Black ${{ matrix.black-version }}
if: matrix.black-version != 'default'
run: |
poetry run pip install black=="${{ matrix.black-version }}"
- name: Lint
if: matrix.pydantic-version == 'default'
run: |
source $VENV
./scripts/lint.sh
- name: Unit Test
run: |
source $VENV
./scripts/test.sh
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.pydantic-version != '1.5.1'
uses: codecov/codecov-action@v5
with:
flags: unittests
files: ./coverage.xml
fail_ci_if_error: true
env_vars: OS,PYTHON,ISORT
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}