Skip to content

refactor: formatting #2

refactor: formatting

refactor: formatting #2

Workflow file for this run

---
name: CI
on:
push:
branches:
- main
- dev
pull_request:
workflow_dispatch:
env:
UV_CACHE_DIR: /tmp/.uv-cache
PROJECT_PATH: "amqtt"
jobs:
code-quality:
name: Check code quality
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout
- name: ⤵️ Checkout repository
uses: actions/checkout@v4
# https://github.com/astral-sh/setup-uv
- name: 🏗 Install uv and Python
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
cache-local-path: ${{ env.UV_CACHE_DIR }}
python-version: "3.13"
- name: 🏗 Install the project
run: uv sync --locked --dev
- name: Run mypy
run: uv run --frozen mypy ${{ env.PROJECT_PATH }}/
- name: Pylint review
run: uv run --frozen pylint ${{ env.PROJECT_PATH }}/
tests:
name: Run tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.12"
- "3.13"
steps:
# https://github.com/actions/checkout
- name: ⤵️ Checkout repository
uses: actions/checkout@v4
# https://github.com/astral-sh/setup-uv
- name: 🏗 Install uv and Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
cache-local-path: ${{ env.UV_CACHE_DIR }}
python-version: ${{ matrix.python-version }}
- name: 🏗 Install the project
run: uv sync --locked --dev
- name: Run pytest
run: uv run --frozen pytest tests --cov=./ --cov-report=xml --junitxml=pytest-report.xml
# https://github.com/actions/upload-artifact
- name: Upload test report
uses: actions/upload-artifact@v4
with:
name: pytest-report-${{ matrix.python-version }}
path: pytest-report.xml
# https://github.com/actions/upload-artifact
- name: Upload coverage results
uses: actions/upload-artifact@v4
with:
name: coverage-results-${{ matrix.python-version }}
path: coverage.xml
# # https://github.com/codecov/codecov-action
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v5
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# fail_ci_if_error: true