Debian Codegraph @

.github/workflows/ci.yml

raw
1 name: CI
2 on:
3 push:
4 pull_request:
5 schedule:
6 - cron: '0 6 * * 6'
7 jobs:
8 test:
9 strategy:
10 fail-fast: false
11 matrix:
12 python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.9-v7.x']
13 os: [ubuntu-latest, windows-latest, macos-latest]
14 include:
15 - python-version: pypy-3.9-v7.x
16 py: pypy3
17 # Just to slim down the test matrix:
18 exclude:
19 - python-version: '3.9'
20 os: macos-latest
21 - python-version: '3.9'
22 os: windows-latest
23 - python-version: '3.10'
24 os: ubuntu-latest
25 - python-version: '3.11'
26 os: macos-latest
27 - python-version: '3.11'
28 os: windows-latest
29 runs-on: ${{ matrix.os }}
30 steps:
31 - uses: actions/checkout@v4
32 - name: Setup Python ${{ matrix.python-version }}
33 uses: actions/setup-python@v5
34 with:
35 python-version: ${{ matrix.python-version }}
36 - name: Install dependencies
37 run: |
38 python -m pip install --upgrade hatch
39 - name: Run tests
40 run: |
41 hatch run +py=${{ matrix.py || matrix.python-version }} test:with-coverage
42 - name: Run integration tests
43 run: |
44 hatch run +py=${{ matrix.py || matrix.python-version }} integration:test
45 shell: bash
46 - name: Upload Codecov Results
47 if: success()
48 uses: codecov/codecov-action@v3
49 with:
50 file: ./coverage.xml
51 flags: unittests
52 name: ${{ matrix.os }}/${{ matrix.python-version }}
53 fail_ci_if_error: false
54
55 lint:
56 runs-on: ubuntu-latest
57 steps:
58 - uses: actions/checkout@v4
59 - name: Setup Python
60 uses: actions/setup-python@v5
61 with:
62 python-version: '3.11'
63 - name: Install Python dependencies
64 run: |
65 python -m pip install --upgrade hatch
66 - name: Setup Node
67 uses: actions/setup-node@v4
68 with:
69 node-version: 20
70 - name: Check with ruff
71 if: always()
72 run: hatch run style:lint
73 - name: Check with mypy
74 if: always()
75 run: hatch run types:check
76 - name: Check Markdown style
77 if: always()
78 run: hatch run lint:markdown
79 - name: Check JS style
80 if: always()
81 run: hatch run lint:js
82 - name: Check spelling
83 if: always()
84 run: hatch run lint:spelling
85
86 package:
87 runs-on: ubuntu-latest
88 steps:
89 - uses: actions/checkout@v4
90 - name: Setup Python
91 uses: actions/setup-python@v5
92 with:
93 python-version: '3.11'
94 - name: Install dependencies
95 run: pip install -U build
96 - name: Build package
97 run: python -m build
98 - name: Check packaged files
99 shell: bash -e -x {0}
100 run: |
101 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}})
102 expected_sdist=("${expected_wheel[@]}" -e{pyproject.toml,hatch_build.py})
103 test "$(tar -ztf dist/mkdocs-*.tar.gz | grep -F "${expected_sdist[@]}" | tee /dev/stderr | wc -l)" -eq "${#expected_sdist[@]}"
104 test "$(unzip -l dist/mkdocs-*any.whl | grep -F "${expected_wheel[@]}" | tee /dev/stderr | wc -l)" -eq "${#expected_wheel[@]}"