-
Notifications
You must be signed in to change notification settings - Fork 2
116 lines (111 loc) · 3.21 KB
/
ci.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
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
POETRY_VERSION: 1.6.1
TOX_VERSION: 4.11.3
COVERALLS_VERSION: 3.3.1
jobs:
linting:
name: "Perform linting checks"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v2"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies"
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install poetry==$POETRY_VERSION
pipx install tox==$TOX_VERSION
- name: Lint with tox
run: |
tox
env:
TOXENV: lint
docs:
name: "Build docs"
needs: linting
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v2"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies"
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install poetry==$POETRY_VERSION
pipx install tox==$TOX_VERSION
- name: Make docs with tox
run: |
tox
env:
TOXENV: docs
tests:
name: tests
needs: linting
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install poetry==$POETRY_VERSION
pipx install tox==$TOX_VERSION
pipx install coveralls==$COVERALLS_VERSION
- name: Prepare toxenv
id: toxenv
run: |
if [[ '${{ matrix.python-version }}' == '3.8' ]]; then
echo "::set-output name=toxenv::py38"
elif [[ '${{ matrix.python-version }}' == '3.9' ]]; then
echo "::set-output name=toxenv::py39"
elif [[ '${{ matrix.python-version }}' == '3.10' ]]; then
echo "::set-output name=toxenv::py310"
elif [[ '${{ matrix.python-version }}' == '3.11' ]]; then
echo "::set-output name=toxenv::py311"
else
echo "::set-output name=toxenv::py312"
fi
- name: Test with tox
run: |
tox
env:
TOXENV: ${{ steps.toxenv.outputs.toxenv }}
- name: Report to Coveralls
run: |
coveralls --service=github
# Only report coverage on latest Python version and skip on prior failures
if: ${{ success() && matrix.python-version == '3.12' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}