chore(ci): update workflow actions to latest versions #15
Workflow file for this run
This file contains 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: CI | |
on: | |
push: | |
branches: ['*'] | |
tags: ['v[0-9]+.[0-9]+.[0-9]+*'] | |
pull_request: | |
branches: ['master'] | |
workflow_dispatch: | |
jobs: | |
tox-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- run: python -m pip install --upgrade pip | |
- run: pip install tox tox-gh-actions | |
- run: tox | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-data-${{ matrix.python-version }} | |
path: .coverage.* | |
include-hidden-files: true | |
retention-days: 1 | |
coverage: | |
name: Coverage Report | |
needs: tox-tests | |
if: always() | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: python -m pip install --upgrade pip | |
- run: pip install coverage[toml] | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: coverage-data-* | |
merge-multiple: true | |
- name: Test coverage | |
run: | | |
coverage combine | |
coverage report --fail-under=100 --show-missing | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/pre-commit | |
~/.cache/pip | |
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | |
- run: python -m pip install --upgrade pip | |
- run: pip install pre-commit | |
- run: pre-commit run -a | |
mypy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pdm-project/setup-pdm@v4 | |
- run: pdm install | |
- run: pdm run mypy | |
publish-to-pypi: | |
needs: [coverage, pre-commit, mypy] | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
environment: | |
name: pypi | |
url: https://pypi.org/p/lektor-index-pages/ | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: pdm-project/setup-pdm@v4 | |
- run: pdm publish |