-
-
Notifications
You must be signed in to change notification settings - Fork 381
102 lines (92 loc) · 2.19 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
name: Lint & Test
on:
push:
branches:
- 2.x
- 1.x
- 0.x
pull_request:
jobs:
# Linting
#
lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- run: pip install '.[test]'
- run: flake8
type-check:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- run: pip install '.[test]'
- run: scripts/check-operation-stub-typing.sh
- run: mypy pyinfra pyinfra_cli
# Unit tests
#
unit-test:
needs:
- lint
- type-check
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-latest]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
include:
- os: macos-12
python-version: "3.11"
- os: windows-2022
python-version: "3.11"
exclude:
- os: ubuntu-latest
python-version: "3.6"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: pip install '.[test]'
- run: pytest --cov --disable-warnings
- uses: codecov/codecov-action@v3
# End-to-end tests
#
end-to-end-test:
needs:
- lint
- type-check
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-latest]
test-name: [local, ssh, docker]
include:
- os: macos-latest
test-name: local
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- run: pip install '.[test]'
- run: pytest -m end_to_end_${{ matrix.test-name }}
# Finally, single jon to check if all completed, for use in protected branch
#
tests-done:
if: ${{ always() }}
needs:
- lint
- type-check
- unit-test
- end-to-end-test
runs-on: ubuntu-latest
steps:
- uses: matrix-org/done-action@v2
with:
needs: ${{ toJSON(needs) }}