馃摴 [GH-1] Check weekly for broken links #5
Workflow file for this run
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: ci | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| lint: | |
| uses: nickatnight/gha-workflows/.github/workflows/pre-commit.yml@main | |
| test: | |
| name: Run tests and coverage | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Set up Python | |
| run: uv python install ${{ matrix.python-version }} | |
| - name: Install the project | |
| run: uv sync | |
| - name: Run mypy | |
| run: make mypy | |
| - name: Run coverage | |
| run: uv run pytest --cov-report=xml:coverage.xml --cov=fastapi_spam/ tests/ | |
| - name: Codecov | |
| if: success() | |
| uses: codecov/codecov-action@v5 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| with: | |
| flags: unittests-py${{ matrix.python-version }} | |
| create-release: | |
| name: Create GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| permissions: | |
| contents: write | |
| needs: [lint, test] | |
| uses: nickatnight/gha-workflows/.github/workflows/create-release.yml@main | |
| secrets: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| upload-release-to-pypi: | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: [create-release] | |
| name: upload release to PyPI | |
| runs-on: ubuntu-latest | |
| environment: pypi | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Set up Python | |
| run: uv python install | |
| - name: Install the project | |
| run: uv sync | |
| - name: Build the package | |
| run: uv build | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |