Bump dependencies #81
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: [push, pull_request] | |
permissions: | |
contents: write | |
jobs: | |
# JOB: Tests | |
tests-job: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11", "3.12", "3.13"] | |
steps: | |
#---------------------------------------------- | |
#---- Checkout and install uv and python | |
#---------------------------------------------- | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v6 | |
with: | |
enable-cache: true | |
- name: Set up Python ${{ matrix.python-version }} | |
run: uv python install ${{ matrix.python-version }} | |
#---------------------------------------------- | |
#---- Install dependencies | |
#---------------------------------------------- | |
- name: uv install | |
run: uv sync --all-extras --dev --python ${{ matrix.python-version }} | |
#---------------------------------------------- | |
#---- Show installation details | |
#---------------------------------------------- | |
- name: uv --version | |
run: uv --version | |
- name: uv run python --version | |
run: uv run python --version | |
- name: ls -lah | |
run: ls -lah | |
- name: uv tree | |
run: uv tree | |
#---------------------------------------------- | |
#---- Linting and Static Analysis | |
#---------------------------------------------- | |
- name: π Ruff checks | |
run: uv run ruff check . | |
- name: π Ruff format checks | |
run: uv run ruff format --check . | |
- name: π Mypy Static Type Checker | |
run: uv run mypy . | |
#---------------------------------------------- | |
#---- Run tests with coverage report | |
#---------------------------------------------- | |
- name: π Run tests with code coverage report | |
run: uv run pytest --cov=statica --cov-report term-missing | |
#---------------------------------------------- | |
#---- Save coverage artifact | |
#---------------------------------------------- | |
- name: Show artifacts (ls -lah) | |
run: ls -lah | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-${{ matrix.python-version }} | |
include-hidden-files: true | |
if-no-files-found: error | |
path: ".coverage" | |
# JOB: Coverage Badge | |
cov-badge-job: | |
needs: tests-job | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
#---------------------------------------------- | |
#---- Download and debug artifact | |
#---------------------------------------------- | |
- uses: actions/download-artifact@v4 | |
with: | |
name: coverage-3.12 | |
path: . | |
#---------------------------------------------- | |
#---- Generate coverage badge | |
#---------------------------------------------- | |
- name: Generate Coverage Badge | |
uses: tj-actions/coverage-badge-py@v2 | |
with: | |
output: assets/coverage.svg | |
#---------------------------------------------- | |
#---- Verify and commit changes | |
#---------------------------------------------- | |
- name: Verify Changed Files | |
uses: tj-actions/verify-changed-files@v17 | |
id: changed_files | |
with: | |
files: assets/coverage.svg | |
- name: Commit Files | |
if: steps.changed_files.outputs.files_changed == 'true' | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add assets/coverage.svg | |
git commit -m "Updated assets/coverage.svg" | |
- name: Push Changes | |
if: steps.changed_files.outputs.files_changed == 'true' | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.github_token }} | |
branch: ${{ github.ref }} |