This repository has been archived by the owner on Jan 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
72 lines (69 loc) · 2.27 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
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"
tags-ignore:
- "**"
pull_request:
schedule:
- cron: 1 0 * * * # Run daily at 0:01 UTC
jobs:
build:
name: ${{ matrix.tox_env }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- tox_env: lint
# - tox_env: docs
- tox_env: py36
PREFIX: PYTEST_REQPASS=1
- tox_env: py36-devel
PREFIX: PYTEST_REQPASS=1
- tox_env: py37
PREFIX: PYTEST_REQPASS=1
- tox_env: py38
PREFIX: PYTEST_REQPASS=1
- tox_env: py39
PREFIX: PYTEST_REQPASS=1
- tox_env: py39-devel
PREFIX: PYTEST_REQPASS=1
- tox_env: packaging
steps:
- uses: actions/checkout@v1
- name: Install system dependencies
run: |
sudo apt-get update \
&& sudo apt-get install -y ansible \
&& ansible-doc -l | grep docker_container
- name: Find python version
id: py_ver
shell: python
if: ${{ contains(matrix.tox_env, 'py') }}
run: |
v = '${{ matrix.tox_env }}'.split('-')[0].lstrip('py')
print('::set-output name=version::{0}.{1}'.format(v[0],v[1:]))
# Even our lint and other envs need access to tox
- name: Install a default Python
uses: actions/setup-python@v2
if: ${{ ! contains(matrix.tox_env, 'py') }}
# Be sure to install the version of python needed by a specific test, if necessary
- name: Set up Python version
uses: actions/setup-python@v2
if: ${{ contains(matrix.tox_env, 'py') }}
with:
python-version: ${{ steps.py_ver.outputs.version }}
- name: Install dependencies
run: |
docker version
docker info
python -m pip install -U pip
pip install tox
- name: Run tox -e ${{ matrix.tox_env }}
run: |
echo "${{ matrix.PREFIX }} tox -e ${{ matrix.tox_env }}"
${{ matrix.PREFIX }} tox -e ${{ matrix.tox_env }}