restore #14
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: | |
workflow_dispatch: | |
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.9" | |
platform: | |
- ubuntu-latest | |
runs-on: ${{ matrix.platform }} | |
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 }}/.pytest_cache/v/pytest_ranking_data | |
key: pytest-ranking-cache-${{ runner.os }}-${{ matrix.python }} | |
- name: Run | |
run: tox | |
- name: List pytest cache | |
run: ls -Rl ${{ github.workspace }} | |
- name: Save pytest-ranking cache | |
id: save-pytest-ranking-cache | |
if: always() | |
uses: actions/cache/save@v4 | |
with: | |
path: ${{ github.workspace }}/.pytest_cache/v/pytest_ranking_data | |
key: pytest-ranking-cache-${{ runner.os }}-${{ matrix.python }}-${{ github.run_id }} | |