-
Notifications
You must be signed in to change notification settings - Fork 22
123 lines (115 loc) · 3.42 KB
/
python-tests.yml
File metadata and controls
123 lines (115 loc) · 3.42 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
name: Python package
on: [pull_request]
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "pypy3.8"]
os: ["ubuntu-22.04", "windows-2022", "macos-11"]
tzdata_extras: ["", "tzdata"]
include:
- { python-version: "3.6", os: "windows-2019", tzdata_extras: "" }
- { python-version: "3.6", os: "windows-2019", tzdata_extras: "tzdata" }
- { python-version: "3.6", os: "macos-10.15", tzdata_extras: "" }
- { python-version: "3.6", os: "macos-10.15", tzdata_extras: "tzdata" }
- { python-version: "3.6", os: "ubuntu-20.04", tzdata_extras: "" }
- { python-version: "3.6", os: "ubuntu-20.04", tzdata_extras: "tzdata" }
env:
TOXENV: py
TEST_EXTRAS_TOX: ${{ matrix.tzdata_extras }}
steps:
- uses: actions/checkout@v3
- name: ${{ matrix.python-version }} - ${{ matrix.os }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip 'tox>=3.18'
- name: Run tests
run: |
python -m tox
c_coverage:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8"]
os: ["ubuntu-22.04"]
include:
- { python-version: "3.6", os: "ubuntu-20.04" }
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: C coverage - ${{ matrix.os }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip 'tox>=3.18'
- name: Run tests
run: |
tox -e gcov
build:
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
matrix:
cc: ["gcc", "clang"]
env:
CC: ${{ matrix.cc }}
CFLAGS: >
-Wall
-Werror
-Wextra
-Wno-unused-result
-Wno-unused-parameter
-Wno-missing-field-initializers
steps:
- uses: actions/checkout@v3
- name: ${{ matrix.toxenv }}
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install tox
run: python -m pip install --upgrade pip 'tox>=3.18'
- name: Build
run: tox -e build,build-check
other:
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
matrix:
toxenv: ["lint", "docs", "mypy"]
env:
TOXENV: ${{ matrix.toxenv }}
steps:
- uses: actions/checkout@v3
- name: ${{ matrix.toxenv }}
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install tox
run: python -m pip install --upgrade pip 'tox>=4.0'
- name: Run action
run: |
if [[ $TOXENV == "build" ]]; then
CFLAGS=""
CFLAGS+=" -Wall"
CFLAGS+=" -Werror"
CFLAGS+=" -Wextra"
CFLAGS+=" -Wno-unused-result"
CFLAGS+=" -Wno-unused-parameter"
CFLAGS+=" -Wno-missing-field-initializers"
export CFLAGS="${CFLAGS}"
TOXENV="build,build-check"
fi
if [[ $TOXENV == "docs" ]]; then
tox -- -j auto -bhtml -W -n -a --keep-going
else
tox
fi