-
-
Notifications
You must be signed in to change notification settings - Fork 16
87 lines (76 loc) · 2.21 KB
/
tox.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
name: tox
on:
push: # only publishes pushes to the main branch to TestPyPI
branches: # any integration branch but not tag
- main
tags-ignore:
- "**"
pull_request:
jobs:
pre:
name: pre
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.generate_matrix.outputs.matrix }}
steps:
- name: Determine matrix
id: generate_matrix
uses: coactions/dynamic-matrix@v1
with:
other_names: |
lint
docs
pkg
alpine:
name: alpine
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run docker build
run: docker build .
unit:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os || 'ubuntu-22.04' }}
needs: pre
strategy:
matrix: ${{ fromJson(needs.pre.outputs.matrix) }}
steps:
- uses: actions/checkout@main
with:
fetch-depth: 0
- name: Set up stock Python ${{ matrix.python_version }} from GitHub
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Log the currently selected Python version info (${{ matrix.python_version }})
run: |
python --version --version
which python
- name: Pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ env.PY_SHA256 }}-${{ hashFiles('setup.cfg') }}-${{ hashFiles('tox.ini') }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('.pre-commit-config.yaml') }}-${{ hashFiles('pytest.ini') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install tox
run: |
python -m pip install -U pip
pip install tox
- name: Run tox run -e ${{ matrix.passed_name }}
run: tox run -e ${{ matrix.passed_name }}
check: # This job does nothing and is only used for the branch protection
if: always()
needs:
- unit
- alpine
runs-on: ubuntu-22.04
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}