Initial commit #6
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
# This workflow exists for several purposes: | |
# | |
# * Ensure that the example in the README is functional. | |
# * Ensure that the desired YAML formatting is enforced. | |
# * Ensure that the example action versions are maintained. | |
# | |
# Update PRs submitted by Dependabot should trigger pre-commit.ci, | |
# which will synchronize changes to this file into the README. | |
# | |
name: "📘 README example" | |
on: | |
pull_request: | |
push: | |
branches: | |
- "main" | |
- "releases" | |
schedule: | |
- cron: "27 19 * * *" | |
jobs: | |
readme_example: | |
name: "Test README example" | |
runs-on: ubuntu-latest | |
steps: | |
# START_README_EXAMPLE_BLOCK | |
- uses: "actions/setup-python@v4" | |
with: | |
python-version: | | |
3.8 | |
3.9 | |
3.10 | |
3.11 | |
3.12 | |
- uses: "kurtmckee/detect-pythons@main" | |
id: "detect-pythons" | |
- run: "echo ${{ steps.detect-pythons.outputs.python-identifiers }} > .python-identifiers" | |
- uses: "actions/cache@v3" | |
id: "restore-cache" | |
with: | |
path: | | |
.tox/ | |
.venv/ | |
key: "${{ hashFiles('.python-identifiers') }}" | |
- name: "Create a virtual environment" | |
if: "steps.restore-cache.outputs.cache-hit == false" | |
run: | | |
python -m venv .venv | |
.venv/bin/python -m pip install tox | |
- name: "Run the test suite against all installed Pythons" | |
run: ".venv/bin/tox" | |
# END_README_EXAMPLE_BLOCK |