-
Notifications
You must be signed in to change notification settings - Fork 5
124 lines (122 loc) · 3.76 KB
/
ci.yml
File metadata and controls
124 lines (122 loc) · 3.76 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: CI
on:
push:
pull_request:
schedule:
- cron: '0 6 * * 6'
defaults:
run:
shell: bash
jobs:
test:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
fail-fast: false
matrix:
include:
- python: '3.14'
os: ubuntu-latest
- python: '3.14'
os: windows-latest
- python: '3.14'
os: macos-latest
- python: '3.13'
os: ubuntu-latest
- python: '3.13'
os: windows-latest
- python: '3.12'
os: macos-latest
- python: '3.12'
os: ubuntu-latest
- python: '3.12'
os: windows-latest
- python: '3.11'
os: ubuntu-latest
- python: '3.11'
os: macos-latest
- python: '3.10'
os: windows-latest
- python: '3.10'
os: ubuntu-latest
versions: minimal
runs-on: ${{matrix.os}}
steps:
- name: Download source
uses: actions/checkout@v6
- name: Install Python
uses: actions/setup-python@v6
with:
python-version: ${{matrix.python}}
- name: Pin to lowest versions
if: matrix.versions == 'minimal'
run: |
sed -i -E 's/#min //; s/\b >=([0-9])/ ==\1/' pyproject.toml
- name: Install Hatch
run: |
pip install hatch
- name: Install dependencies
run: |
hatch run test:pip freeze
- name: Run tests
run: |
hatch run +py=${{matrix.python}} test:test
- name: Run integration tests
if: matrix.versions != 'minimal'
run: |
hatch run +py=${{matrix.python}} integration:test
style:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- name: Download source
uses: actions/checkout@v6
- name: Install Python
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Install Hatch
run: |
pip install hatch
- name: Install Node
uses: actions/setup-node@v6
with:
node-version: 24
- name: Install dependencies
run: |
hatch run style:pip freeze
hatch run types:pip freeze
- name: Check with ruff
if: always()
run: hatch run style:check
- name: Check with mypy
if: always()
run: hatch run types:check
- name: Check Markdown style
if: always()
run: hatch run lint:markdown
- name: Check JS style
if: always()
run: hatch run lint:js
- name: Check spelling
if: always()
run: hatch run lint:spelling
package:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Install dependencies
run: pip install -U build
- name: Build package
run: python -m build
- name: Check packaged files
shell: bash -e -x {0}
run: |
expected_wheel=(-eproperdocs/{templates/sitemap.xml,config/base.py,py.typed,contrib/search/lunr-language/lunr.nl.js})
expected_sdist=("${expected_wheel[@]}" -epyproject.toml)
test "$(tar -ztf dist/properdocs-*.tar.gz | grep -F "${expected_sdist[@]}" | tee /dev/stderr | wc -l)" -eq "${#expected_sdist[@]}"
test "$(unzip -l dist/properdocs-*any.whl | grep -F "${expected_wheel[@]}" | tee /dev/stderr | wc -l)" -eq "${#expected_wheel[@]}"