-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (131 loc) · 4.58 KB
/
ci.yml
File metadata and controls
136 lines (131 loc) · 4.58 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
125
126
127
128
129
130
131
132
133
134
135
136
name: CI
on:
push:
pull_request:
schedule:
- cron: '0 6 * * 6'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
test-smoke:
name: Smoke tests (${{ matrix.os }}, ${{ matrix.python-version }})
if: github.event_name == 'pull_request' || github.event_name == 'push'
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
python-version: '3.8'
test-script: test:test
- os: ubuntu-latest
python-version: '3.14'
test-script: test:with-coverage
upload-coverage: true
- os: ubuntu-latest
python-version: pypy-3.11
py: pypy3
test-script: test:test
- os: macos-latest
python-version: '3.14'
test-script: test:test
- os: windows-latest
python-version: '3.14'
test-script: test:test
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade hatch
- name: Run tests
run: |
hatch run +py=${{ matrix.py || matrix.python-version }} ${{ matrix.test-script }}
- name: Run integration tests
run: |
export DISABLE_MKDOCS_2_WARNING=true
hatch run +py=${{ matrix.py || matrix.python-version }} integration:test
shell: bash
- name: Upload Codecov Results
if: success() && matrix.upload-coverage
uses: codecov/codecov-action@v6
with:
file: ./coverage.xml
flags: unittests
name: smoke/${{ matrix.os }}/${{ matrix.python-version }}
fail_ci_if_error: false
test-full:
name: Full tests (ubuntu, ${{ matrix.python-version }})
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
strategy:
fail-fast: false
matrix:
include:
- python-version: '3.8'
- python-version: '3.9'
- python-version: '3.10'
- python-version: '3.11'
- python-version: '3.12'
- python-version: '3.13'
- python-version: '3.14'
- python-version: pypy-3.11
py: pypy3
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade hatch
- name: Run tests
run: |
hatch run +py=${{ matrix.py || matrix.python-version }} test:test
- name: Run integration tests
run: |
hatch run +py=${{ matrix.py || matrix.python-version }} integration:test
shell: bash
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install Python dependencies
run: |
python -m pip install --upgrade hatch pre-commit
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 24
- name: Run repository checks
if: always()
run: pre-commit run --all-files --show-diff-on-failure
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
- 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=(-emkdocs/{templates/sitemap.xml,config/base.py,py.typed,contrib/search/lunr-language/lunr.nl.js,themes/{mkdocs,readthedocs}/{base.html,locales/{de,es}/LC_MESSAGES/messages.mo}})
expected_sdist=("${expected_wheel[@]}" -e{pyproject.toml,hatch_build.py})
test "$(tar -ztf dist/mkdocs_ng-*.tar.gz | grep -F "${expected_sdist[@]}" | tee /dev/stderr | wc -l)" -eq "${#expected_sdist[@]}"
test "$(unzip -l dist/mkdocs_ng-*any.whl | grep -F "${expected_wheel[@]}" | tee /dev/stderr | wc -l)" -eq "${#expected_wheel[@]}"