Skip to content

Run tox

Run tox #261

Workflow file for this run

# 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@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.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 }}