Skip to content

refact: rename and cleanup #48

refact: rename and cleanup

refact: rename and cleanup #48

Workflow file for this run

# SPDX-FileCopyrightText: 2025 Abilian SAS
# SPDX-License-Identifier: Apache-2.0
name: Tests
on:
push:
branches: [main, devel]
pull_request:
branches: [main, devel]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.13"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies
run: |
uv sync --inexact
- name: Run unit tests
run: |
uv run pytest -v --tb=short packages/hop3-server/tests/a_unit
- name: Run integration tests
run: |
uv run pytest -v --tb=short packages/hop3-server/tests/b_integration
- name: Run CLI tests
run: |
uv run pytest -v --tb=short packages/hop3-cli/tests
lint:
name: Lint and Type Check
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies
run: |
uv sync --inexact
- name: Run ruff linting
run: |
uv run ruff check packages/*/src packages/*/tests
- name: Check dependency health
run: |
cd packages/hop3-server && uv run deptry src
security:
name: Security Checks
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies
run: |
uv sync --inexact
- name: Run security checks with pip-audit
run: |
uv tool install pip-audit
uv pip list --format=freeze | uv tool run pip-audit --skip-editable
continue-on-error: true
- name: Check for security vulnerabilities with safety
run: |
uv tool install safety
uv pip list --format=freeze | uv tool run safety check --stdin
continue-on-error: true
coverage:
name: Code Coverage
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: actions/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies
run: |
uv sync --inexact
- name: Run tests with coverage
run: |
uv run pytest \
--cov=hop3 \
--cov-report=term-missing \
--cov-report=xml \
--cov-report=html \
packages/hop3-server/tests/a_unit \
packages/hop3-server/tests/b_integration \
packages/hop3-cli/tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: htmlcov/
retention-days: 7