forked from pyinfra-dev/pyinfra
-
Notifications
You must be signed in to change notification settings - Fork 0
152 lines (141 loc) · 3.79 KB
/
test.yml
File metadata and controls
152 lines (141 loc) · 3.79 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
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
147
148
149
150
151
152
name: Lint & Test
on:
push:
branches:
- 3.x
- 2.x
- 1.x
- 0.x
pull_request:
jobs:
# Linting
#
lint:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install uv
uses: astral-sh/setup-uv@v6
- uses: astral-sh/ruff-action@v3
with:
args: "check --diff"
- uses: astral-sh/ruff-action@v3
with:
args: "format --diff"
type-check:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install uv
uses: astral-sh/setup-uv@v6
- run: uv sync --group test --no-default-groups
- run: uv run mypy
- run: uv run python scripts/lint_arguments_sync.py
spell-check:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- name: Check spelling
uses: crate-ci/typos@v1.30.3
unit-test:
needs:
- lint
- type-check
- spell-check
strategy:
matrix:
os: [macos-26, macos-15, macos-14, windows-2025, windows-2022, ubuntu-24.04, ubuntu-22.04]
# Test every OS vs. Python 3.13, and only one for 3.1[012]
python-version: ["3.13"]
include:
- os: ubuntu-24.04
python-version: "3.12"
- os: ubuntu-24.04
python-version: "3.11"
- os: ubuntu-24.04
python-version: "3.10"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v6
- run: uv sync --group test --no-default-groups --python=${{ matrix.python-version }}
- run: uv run pytest --cov --disable-warnings
- name: Upload coverage report to codecov
if: ${{ matrix.os == 'ubuntu-24.04' && matrix.python-version == '3.13' }}
uses: codecov/codecov-action@v5
# End-to-end tests
#
end-to-end-test:
needs:
- lint
- type-check
- spell-check
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
test-name: [local, ssh, docker, podman]
include:
- os: macos-14
test-name: local
- os: macos-15
test-name: local
- os: macos-26
test-name: local
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install uv
uses: astral-sh/setup-uv@v6
- run: uv sync --group test --no-default-groups --python=${{ matrix.python-version }}
- run: uv run pytest -m end_to_end_${{ matrix.test-name }}
docs-build:
needs:
- lint
- type-check
- spell-check
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- name: Fetch git tags
run: git fetch --tags origin
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install
run: |
uv sync --group docs --no-default-groups
uv pip install 'jinja2<3.1'
- name: Generate documentation
run: scripts/build-public-docs.sh
env:
PYTHONPATH: '.'
# Finally, single job to check if all completed, for use in protected branch
tests-done:
if: ${{ always() }}
needs:
- lint
- type-check
- spell-check
- unit-test
- end-to-end-test
- docs-build
runs-on: ubuntu-latest
steps:
- uses: matrix-org/done-action@v3
with:
needs: ${{ toJSON(needs) }}