CI: Update GitHub Actions #172
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Tests | |
| on: # yamllint disable-line rule:truthy | |
| push: | |
| pull_request: | |
| branches: | |
| - master | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| name: Linters | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.x" | |
| - run: | |
| pip install flake8 flake8-import-order ruff sphinx sphinx_rtd_theme | |
| rstcheck[sphinx] doc8 | |
| - run: pip install . | |
| - run: flake8 . | |
| - run: ruff check --output-format=github | |
| - run: doc8 $(git ls-files '*.rst') | |
| - run: rstcheck --ignore-directives automodule $(git ls-files '*.rst') | |
| - run: yamllint --strict $(git ls-files '*.yaml' '*.yml') | |
| - run: make -C docs html | |
| - name: Check for broken links in documentation | |
| run: make -C docs linkcheck | |
| test: | |
| name: Unit tests | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: | |
| - '3.9' | |
| - '3.10' | |
| - '3.11' | |
| - '3.12' | |
| - '3.13' | |
| - '3.13t' | |
| - '3.14' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true # needed for 3.14 | |
| - name: Append GitHub Actions system path | |
| run: echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Keep the GIL disabled with free-threaded Python | |
| if: endsWith(matrix.python-version, 't') | |
| run: echo "PYTHON_GIL=0" >> $GITHUB_ENV | |
| - run: pip install coverage | |
| - run: pip install . | |
| # https://github.com/AndreMiras/coveralls-python-action/issues/18 | |
| - run: echo -e "[run]\nrelative_files = True" > .coveragerc | |
| - run: >- | |
| python | |
| -X warn_default_encoding | |
| -W error::EncodingWarning | |
| -m coverage | |
| run | |
| -m unittest | |
| discover | |
| - name: Coveralls | |
| uses: AndreMiras/coveralls-python-action@develop |