Run tox #265
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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
- 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 }} |