-
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (66 loc) · 2.17 KB
/
readme_example.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# 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:
strategy:
matrix:
run:
- os:
id: "ubuntu-latest"
name: "Linux"
- os:
id: "macos-latest"
name: "macOS"
- os:
id: "windows-latest"
name: "Windows"
name: "Test ${{ matrix.run.os.name }}"
runs-on: "${{ matrix.run.os.id }}"
steps:
# START_README_EXAMPLE_BLOCK
- uses: "actions/setup-python@v4"
with:
python-version: |
pypy3.10
3.11
- uses: "kurtmckee/detect-pythons@main"
- uses: "actions/cache@v3"
id: "restore-cache"
with:
# You may need to augment the list of files to hash.
# For example, you might add 'requirements/*.txt' or 'pyproject.toml'.
key: "${{ hashFiles('.python-identifiers') }}"
path: |
.tox/
.venv/
- name: "Identify .venv path"
shell: "bash"
run: "echo 'venv-path=${{ runner.os == 'Windows' && '.venv/Scripts' || '.venv/bin' }}' >> $GITHUB_ENV"
- name: "Create a virtual environment"
if: "steps.restore-cache.outputs.cache-hit == false"
run: |
python -m venv .venv
${{ env.venv-path }}/python -m pip install --upgrade pip setuptools wheel
# You may need to customize what gets installed next.
# However, tox is able to run test suites against multiple Pythons,
# so it's a helpful tool for efficient testing.
${{ env.venv-path }}/pip install tox
- name: "Run the test suite against all installed Pythons"
run: "${{ env.venv-path }}/tox"
# END_README_EXAMPLE_BLOCK