-
-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (99 loc) · 2.97 KB
/
Copy pathbuild.yml
File metadata and controls
107 lines (99 loc) · 2.97 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Build Python distribution
on:
push:
branches:
- main
- "v*.*.*"
- "test-me-*"
tags:
- "v*.*.*"
pull_request:
branches:
- main
- "v*.*.*"
types:
- opened # default
- synchronize # default
- reopened # default
- ready_for_review # used in PRs created from the release workflow
env:
PYTEST_ADDOPTS: "--color=yes"
# Cancel running jobs for the same workflow and branch.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
env:
- "3.11"
- "3.12"
- "3.13"
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.7.16"
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Install tox
run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv
- name: Install Python
if: startsWith(matrix.env, '3.') && matrix.env != '3.13'
run: uv python install --python-preference only-managed ${{ matrix.env }}
- name: Setup environment ${{ matrix.env }}
run: tox run --notest --skip-missing-interpreters false -e ${{ matrix.env }}
- name: Run environment ${{ matrix.env }}
run: tox run --skip-pkg-install -e ${{ matrix.env }}
- name: Generate reports
shell: bash
run: |
if [ -f "test-report.md" ]; then
echo "### Test Report" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
cat "test-report.md" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
rm -f test-report.md
fi
if [ -f "test-coverage.md" ]; then
echo "### Code coverage" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
cat "test-coverage.md" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
rm -f test-coverage.md
fi
doc:
needs:
- build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.7.16"
python-version: "3.13"
- name: Install the project
run: uv sync --all-extras --dev
- name: Install tox
run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv
- name: Generate documentation
shell: bash
run: |
tox run -e docs
- name: Upload documentation
uses: actions/upload-pages-artifact@v3
with:
path: ./docs/_build/html
- name: Publish documentation on GitHub Pages
uses: actions/deploy-pages@v4
id: deployment