chore(deps): update dependency tox to ~4.9.0 (#314) #1778
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
--- | |
name: push workflow | |
on: [push, workflow_dispatch] | |
jobs: | |
run: | |
name: Python ${{ matrix.python-version }} | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 5 | |
matrix: | |
python-version: | |
- "3.10" | |
env: | |
OS: ubuntu-latest | |
PYTHON: ${{ matrix.python-version }} | |
steps: | |
- uses: actions/[email protected] | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
cache-dependency-path: pyproject.toml | |
- name: Cache tox environments | |
id: cache-tox | |
uses: actions/[email protected] | |
with: | |
path: | | |
~/.cache/pre-commit | |
.tox | |
.venv | |
# pyproject.toml, poetry.lock and .pre-commit-config.yaml have versioning info that would | |
# impact the tox environment. | |
key: tox-${{ matrix.python-version }}-${{ hashFiles( | |
'pyproject.toml', | |
'poetry.lock', | |
'.pre-commit-config.yaml', | |
'tox.ini') }} | |
- name: "get poetry version from .tool-versions" | |
run: | | |
set -eux | |
cat .tool-versions | |
POETRY_VERSION=$(grep -oP '(?<=poetry\s).+' .tool-versions) | |
if [ -z "$POETRY_VERSION" ]; then | |
exit 1 | |
fi | |
echo "POETRY_VERSION=${POETRY_VERSION}" >> $GITHUB_ENV | |
- name: Install dependencies | |
run: | | |
set -eux | |
python -m pip install --upgrade pip | |
pip install poetry==${{ env.POETRY_VERSION }} | |
poetry install --no-interaction | |
- name: Run versions | |
run: | | |
set -eux | |
pip --version | |
poetry --version | |
poetry env info | |
- name: Run tox | |
run: | | |
set -eux | |
poetry run tox | |
- name: Upload coverage to Codecov | |
uses: codecov/[email protected] | |
with: | |
# token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos | |
file: ./coverage.xml | |
flags: pytest | |
env_vars: OS,PYTHON | |
fail_ci_if_error: true |