👷 Deduplicate cron GHA through workflow reuse #2266
Workflow file for this run
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: QA | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
tags: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
qa: | |
name: ${{ matrix.toxenv }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
toxenv: | |
- readme | |
- build-docs | |
- linkcheck-docs | |
python-version: | |
- "3.x" | |
env: | |
PY_COLORS: 1 | |
TOXENV: ${{ matrix.toxenv }} | |
TOX_PARALLEL_NO_SPINNER: 1 | |
steps: | |
- uses: actions/checkout@main | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Get pip cache dir | |
id: pip-cache | |
run: | | |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT | |
- name: Pip cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.pip-cache.outputs.dir }} | |
key: >- | |
${{ runner.os }}-pip-${{ hashFiles('setup.cfg') }}-${{ | |
hashFiles('pyproject.toml') }}-${{ hashFiles('tox.ini') }}-${{ | |
hashFiles('.pre-commit-config.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
${{ runner.os }}- | |
- name: Prepare cache key | |
id: cache-key | |
run: echo "sha-256=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pre-commit | |
key: pre-commit|${{ steps.cache-key.outputs.sha-256 }}|${{ hashFiles('.pre-commit-config.yaml') }} | |
- name: Install tox | |
run: pip install tox | |
- name: Prepare test environment | |
run: tox --notest -p auto --parallel-live | |
- name: Test ${{ matrix.toxenv }} | |
run: tox |