README: update installation instructions #19
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: Tests | |
on: | |
push: | |
branches: | |
- "master" | |
- "release-*" | |
pull_request: | |
branches: | |
- "master" | |
- "release-*" | |
workflow_dispatch: | |
env: | |
PYTEST_ADDOPTS: "-vv --cov-report=xml:coverage-ci.xml" | |
PIP_DISABLE_PIP_VERSION_CHECK: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
tests: | |
name: Tests | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 5 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04, windows-latest, macos-latest] | |
python: ["3.8"] | |
tox_env: ["coverage"] | |
include: | |
- tox_env: "py38-ipython-coverage" | |
os: ubuntu-20.04 | |
python: "3.8" | |
- tox_env: "py38-editable-coverage" | |
os: ubuntu-20.04 | |
python: "3.8" | |
- tox_env: "py39-coverage" | |
os: ubuntu-20.04 | |
python: "3.9" | |
- tox_env: "py310-coverage" | |
python: "3.10" | |
os: ubuntu-20.04 | |
- tox_env: "py311-coverage" | |
python: "3.11" | |
os: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: set PY_CACHE_KEY | |
run: echo "PY_CACHE_KEY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV | |
- name: Cache .tox | |
uses: actions/cache@v3 | |
with: | |
path: ${{ github.workspace }}/.tox/${{ matrix.tox_env }} | |
key: "tox|${{ matrix.os }}|${{ matrix.tox_env }}|${{ env.PY_CACHE_KEY }}|${{ hashFiles('tox.ini', 'setup.*') }}" | |
- name: Update tools and print info | |
run: | | |
pip install -U pip setuptools virtualenv | |
pip list | |
- name: Install tox | |
run: pip install tox | |
- name: Setup tox environment | |
id: setup_tox | |
run: tox --notest -v -e ${{ matrix.tox_env }} | |
- name: Test | |
env: | |
COLUMNS: "90" # better alignment (working around https://github.com/blueyed/pytest/issues/491). | |
PY_COLORS: "1" | |
run: | | |
if [[ ${{ matrix.os }} = "windows-latest" ]]; then | |
# UTF-8 mode for Windows (https://docs.python.org/3/using/windows.html#utf-8-mode). | |
export PYTHONUTF8=1 TOX_TESTENV_PASSENV=PYTHONUTF8 | |
fi | |
python -m tox -v -e ${{ matrix.tox_env }} | |
- name: Report coverage | |
if: always() && (contains(matrix.tox_env, 'coverage') && (steps.setup_tox.outcome == 'success')) | |
uses: codecov/codecov-action@v3 | |
with: | |
files: ./coverage-ci.xml | |
flags: ${{ runner.os }} | |
name: ${{ matrix.tox_env }} | |
fail_ci_if_error: true |