File: ci.yml

package info (click to toggle)
python-mkdocs 1.6.1%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,816 kB
  • sloc: python: 14,346; javascript: 10,535; perl: 143; sh: 57; makefile: 30; xml: 11
file content (104 lines) | stat: -rw-r--r-- 3,419 bytes parent folder | download | duplicates (2)
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
name: CI
on:
  push:
  pull_request:
  schedule:
    - cron: '0 6 * * 6'
jobs:
  test:
    strategy:
      fail-fast: false
      matrix:
        python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.9-v7.x']
        os: [ubuntu-latest, windows-latest, macos-latest]
        include:
          - python-version: pypy-3.9-v7.x
            py: pypy3
        # Just to slim down the test matrix:
        exclude:
          - python-version: '3.9'
            os: macos-latest
          - python-version: '3.9'
            os: windows-latest
          - python-version: '3.10'
            os: ubuntu-latest
          - python-version: '3.11'
            os: macos-latest
          - python-version: '3.11'
            os: windows-latest
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v4
      - name: Setup Python ${{ matrix.python-version }}
        uses: actions/setup-python@v5
        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:with-coverage
      - name: Run integration tests
        run: |
          hatch run +py=${{ matrix.py || matrix.python-version }} integration:test
        shell: bash
      - name: Upload Codecov Results
        if: success()
        uses: codecov/codecov-action@v3
        with:
          file: ./coverage.xml
          flags: unittests
          name: ${{ matrix.os }}/${{ matrix.python-version }}
          fail_ci_if_error: false

  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Setup Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'
      - name: Install Python dependencies
        run: |
          python -m pip install --upgrade hatch
      - name: Setup Node
        uses: actions/setup-node@v4
        with:
          node-version: 20
      - name: Check with ruff
        if: always()
        run: hatch run style:lint
      - 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:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Setup Python
        uses: actions/setup-python@v5
        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-*.tar.gz | grep -F "${expected_sdist[@]}" | tee /dev/stderr | wc -l)" -eq "${#expected_sdist[@]}"
          test "$(unzip -l dist/mkdocs-*any.whl | grep -F "${expected_wheel[@]}" | tee /dev/stderr | wc -l)" -eq "${#expected_wheel[@]}"