| # GitHub Action to check our dictionary, this should only be used by the codespell project itself | |
| # For general usage in your repo, see the example in codespell.yml | |
| # https://github.com/codespell-project/codespell | |
| # Concurrency cancels an action on a given PR once a new commit is pushed | |
| name: Pytest | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }} | |
| cancel-in-progress: true | |
| on: [push, pull_request] | |
| permissions: {} | |
| jobs: | |
| test: | |
| env: | |
| REQUIRE_ASPELL: ${{ startsWith(matrix.os, 'ubuntu') }} | |
| RUFF_OUTPUT_FORMAT: github | |
| # Make sure we're using the latest aspell dictionary | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: | |
| - "3.9" | |
| - "3.10" | |
| - "3.11" | |
| - "3.12" | |
| - "3.13" | |
| - "3.14" | |
| kind: | |
| - "standard" | |
| os: | |
| - "ubuntu-24.04-arm" | |
| include: | |
| - python-version: "3.10" | |
| kind: "old" | |
| os: "ubuntu-24.04-arm" | |
| - python-version: "3.10" | |
| kind: "no-toml" | |
| os: "ubuntu-24.04-arm" | |
| - python-version: "3.13" | |
| kind: "standard" | |
| os: "windows-latest" | |
| name: "${{ matrix.python-version }} ${{ matrix.kind }} ${{ matrix.os }}" | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| - name: Setup python | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - run: sudo apt-get install libaspell-dev aspell-en | |
| if: startsWith(matrix.os, 'ubuntu') | |
| - name: Install dependencies | |
| shell: bash -e {0} | |
| run: | | |
| python --version # just to check | |
| python -m pip install --upgrade pip wheel | |
| pip install --upgrade setuptools docutils setuptools_scm[toml] twine | |
| pip install -e . --group dev # install the codespell dev packages | |
| - run: pip install aspell-python-py3 | |
| if: startsWith(matrix.os, 'ubuntu') | |
| - run: pip install "chardet<7" | |
| if: ${{ matrix.kind == 'old' }} | |
| - run: codespell --help | |
| - run: codespell --version | |
| - run: make check | |
| if: startsWith(matrix.os, 'ubuntu') | |
| - run: pytest codespell_lib | |
| if: startsWith(matrix.os, 'windows') | |
| - uses: codecov/codecov-action@v7 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| # tomli should not be required for the next two steps (and make sure it's not) | |
| - run: pip uninstall -yq tomli | |
| if: ${{ matrix.kind == 'no-toml' }} | |
| - run: codespell --check-filenames --skip="./.*,./build/*,./codespell_lib/data/*,./codespell_lib/tests/test_basic.py,./example/code.c,./junit-results.xml,*.egg-info/*,*.pyc,*.sig,pyproject-codespell.precommit-toml,README.rst," | |
| # this file has an error | |
| - run: "! codespell codespell_lib/tests/test_basic.py" | |
| shell: bash -e {0} | |
| make-check-dictionaries: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Setup Python | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: 3.x | |
| - uses: actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| - name: Install general dependencies | |
| run: pip install --upgrade pip wheel | |
| - name: Install codespell dependencies | |
| run: pip install -e . --group dev | |
| - uses: codespell-project/sort-problem-matcher@v1 | |
| - run: make check-dictionaries |