This repository has been archived by the owner on Jan 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
98 lines (86 loc) · 2.79 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
88
89
90
91
92
93
94
95
96
97
98
name: tox
on:
create: # is used for publishing to PyPI and TestPyPI
tags: # any tag regardless of its name, no branches
- "**"
push: # only publishes pushes to the main branch to TestPyPI
branches: # any integration branch but not tag
- "main"
pull_request:
release:
types:
- published # It seems that you can publish directly without creating
schedule:
- cron: 1 0 * * * # Run daily at 0:01 UTC
jobs:
build:
name: ${{ matrix.tox_env }}
# macos is the only gh action platform with support for vagrant/virtualbox
# According to:
# https://github.com/actions/runner-images/blob/main/images/macos/macos-11-Readme.md
# https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md
# -> macos-12 has them but not macos-11
# -> don't use macos-latest for safety
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
include:
- tox_env: lint
platform: ubuntu-latest
skip_vagrant: true
- tox_env: py39,py39-devel
PREFIX: PYTEST_REQPASS=11
platform: macos-12
python_version: "3.9"
- tox_env: py310,py310-devel
PREFIX: PYTEST_REQPASS=11
platform: macos-12
python_version: "3.10"
- tox_env: pkg
platform: ubuntu-latest
skip_vagrant: true
steps:
- name: Check vagrant presence
run: |
vagrant version
vagrant plugin list
if: ${{ ! matrix.skip_vagrant }}
- name: Check out src from Git
uses: actions/checkout@v3
with:
fetch-depth: 0 # needed by setuptools-scm
- name: Enable vagrant box caching
uses: actions/cache@v3
if: ${{ ! matrix.skip_vagrant }}
with:
path: |
~/.vagrant.d/boxes
key: ${{ runner.os }}-${{ hashFiles('tools/Vagrantfile') }}
# Be sure to install the version of python needed by a specific test, if necessary
- name: Set up Python version
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version || '3.9' }}
cache: pip
- name: Install dependencies
run: |
python -m pip install -U pip
pip install tox
- name: Create test box
run: |
./tools/create_testbox.sh
if: ${{ ! matrix.skip_vagrant }}
- name: Run tox -e ${{ matrix.tox_env }}
run: |
echo "${{ matrix.PREFIX }} tox -e ${{ matrix.tox_env }}"
${{ matrix.PREFIX }} tox -e ${{ matrix.tox_env }}
check:
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Report success of the test matrix
run: >-
print("All's good")
shell: python