Skip to content

py test cache for tox #19

py test cache for tox

py test cache for tox #19

Workflow file for this run

name: pytest-ranking CI
on:
push:
workflow_dispatch:
concurrency:
group: >-
${{ github.workflow }}-
${{ github.ref_type }}-
${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions:
contents: read
env:
# Environment variable to support color support (jaraco/skeleton#66)
FORCE_COLOR: 1
# Suppress noisy pip warnings
PIP_DISABLE_PIP_VERSION_CHECK: 'true'
PIP_NO_PYTHON_VERSION_WARNING: 'true'
PIP_NO_WARN_SCRIPT_LOCATION: 'true'
# Ensure tests can sense settings about the environment
TOX_OVERRIDE: >-
testenv.pass_env+=GITHUB_*,FORCE_COLOR
jobs:
test:
strategy:
matrix:
python:
- "3.8"
platform:
- ubuntu-latest
runs-on: ${{ matrix.platform }}
env:
SETUPTOOLS_USE_DISTUTILS: ${{ matrix.distutils || 'local' }}
timeout-minutes: 75
steps:
- uses: actions/checkout@v4
- name: Setup Python
id: python-install
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
allow-prereleases: true
- uses: actions/cache@v3
id: cache
with:
path: setuptools/tests/config/downloads/*.cfg
key: >-
${{ hashFiles('setuptools/tests/config/setupcfg_examples.txt') }}-
${{ hashFiles('setuptools/tests/config/downloads/*.py') }}
- name: Populate download cache
if: steps.cache.outputs.cache-hit != 'true'
working-directory: setuptools/tests/config
run: python -m downloads.preload setupcfg_examples.txt
- name: Pre-build distributions for test
shell: bash
run: |
rm -rf dist
pipx run build
echo "PRE_BUILT_SETUPTOOLS_SDIST=$(ls dist/*.tar.gz)" >> $GITHUB_ENV
echo "PRE_BUILT_SETUPTOOLS_WHEEL=$(ls dist/*.whl)" >> $GITHUB_ENV
rm -rf setuptools.egg-info # Avoid interfering with the other tests
- name: Workaround for unreleased PyNaCl (pyca/pynacl#805)
if: contains(matrix.python, 'pypy')
run: echo "SETUPTOOLS_ENFORCE_DEPRECATION=0" >> $GITHUB_ENV
- name: Install tox
run: python -m pip install tox
- name: Restore pytest-ranking cache
id: restore-pytest-ranking-cache
if: always()
uses: actions/cache/restore@v4
with:
path: ${{ github.workspace }}/.tox/py/.pytest_cache/v/pytest_ranking_data
key: pytest-ranking-cache-${{ runner.os }}-${{ matrix.python }}
- name: Run
run: tox
- name: Save pytest-ranking cache
id: save-pytest-ranking-cache
if: always()
uses: actions/cache/save@v4
with:
path: ${{ github.workspace }}/.tox/py/.pytest_cache/v/pytest_ranking_data
key: pytest-ranking-cache-${{ runner.os }}-${{ matrix.python }}-${{ github.run_id }}