-
Notifications
You must be signed in to change notification settings - Fork 28
49 lines (42 loc) · 1.5 KB
/
run_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
# Copyright (C) 2021 Sebastian Pipping <[email protected]>
# Licensed under the MIT license
name: Run tox
on:
pull_request:
push:
schedule:
- cron: '0 16 * * 5' # Every Friday at 16:00
jobs:
run_tox:
name: Run tox
runs-on: ubuntu-20.04
strategy:
matrix:
python-version:
- 3.7 # oldest supported version
# - 3.8 # no particial need
# - 3.9 # no particial need
- '3.10' # includes tox env about code coverage
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: |-
pip install \
--disable-pip-version-check \
--user \
--no-warn-script-location \
tox
echo "PATH=${HOME}/.local/bin:${PATH}" >> "${GITHUB_ENV}"
- name: Run tox (environments matching Python ${{ matrix.python-version }})
run: |-
set -x
python_version_without_dot="$(sed 's,\.,,' <<< "${{ matrix.python-version }}")"
function join_by { local IFS="$1"; shift; echo "$*"; }
tox_envs=( $(tox --listenvs | fgrep "py${python_version_without_dot}-") )
tox -e "$(join_by ',' "${tox_envs[@]}")"
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}