Skip to content

⬆️ Lock file maintenance (#188) #467

⬆️ Lock file maintenance (#188)

⬆️ Lock file maintenance (#188) #467

Workflow file for this run

---
name: CI
# yamllint disable-line rule:truthy
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
pre-commit:
name: pre-commit
runs-on: ubuntu-latest
env:
PRE_COMMIT_HOME: /tmp/pre-commit-cache
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: 🏗 Set up uv
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
with:
enable-cache: true
- name: 🏗 Set pre-commit cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ${{ env.PRE_COMMIT_HOME }}
key: ${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml','.python-version') }}
- name: 🚀 Run pre-commit
env:
# Skipping branch check and pytest as pytest is run in a separate job
SKIP: no-commit-to-branch,pytest
run: uv run --frozen pre-commit run -a
pytest:
name: pytest
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.12", "3.13", "3.14"]
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: 🏗 Set up uv
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
with:
enable-cache: true
- name: 🏗 Set up Python ${{ matrix.python }}
run: uv python install ${{ matrix.python }}
- name: 🏗 Install dependencies
run: uv sync --frozen --dev
- name: 🚀 Run pytest
run: uv run pytest --cov go2rtc_client tests
- name: ⬆️ Upload coverage artifact
uses: actions/upload-artifact@v5.0.0
with:
include-hidden-files: true
name: coverage-${{ matrix.python }}
path: .coverage
coverage:
runs-on: ubuntu-latest
needs: pytest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
fetch-depth: 0
- name: ⬇️ Download coverage data
uses: actions/download-artifact@v6.0.0
- name: 🏗 Set up uv
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
with:
enable-cache: true
- name: 🏗 Install dependencies
run: uv sync --frozen --dev
- name: 🚀 Process coverage results
run: |
uv run --frozen coverage combine coverage*/.coverage*
uv run --frozen coverage xml -i
- name: ⬆️ Upload coverage report
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}