Run tox #283
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (C) 2021 Sebastian Pipping <sebastian@pipping.org> | |
# 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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1 | |
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 }} |