Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@ jobs:
with:
python-version: "3.13"

- name: Setup uv
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2

- name: Install dependencies
run: pip install -e .[dev]
run: uv sync --dev

- name: Run benchmarks
uses: CodSpeedHQ/action@4348f634fa7309fe23aac9502e88b999ec90a164 #v3
with:
token: ${{ secrets.CODSPEED_TOKEN }}
run: pytest tests/ --codspeed
run: uv run pytest tests/ --codspeed
mode: instrumentation
19 changes: 10 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Test

on:
push:
branches: main
branches: [main]
pull_request:
branches: main
branches: [main]
workflow_dispatch:

jobs:
Expand All @@ -22,16 +22,17 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Setup uv
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev]
run: uv sync --dev

- name: Run tests and collect coverage
run: |
coverage run --source=tests,cpp_linter_hooks -m pytest -vv
coverage report
coverage xml
run: |-
uv run coverage run --source=tests,cpp_linter_hooks -m pytest -vv
uv run coverage report
uv run coverage xml
- uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 #v5
if: matrix.python-version == '3.13'
with:
Expand Down
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
requires = ["setuptools>=45", "setuptools-scm"]
build-backend = "setuptools.build_meta"

requires-python = ">=3.9"

[project]
requires-python = ">=3.9"
name = "cpp_linter_hooks"
description = "Automatically formats and lints C/C++ code using clang-format and clang-tidy"
readme = "README.md"
Expand Down Expand Up @@ -48,7 +47,7 @@ clang-tidy-hook = "cpp_linter_hooks.clang_tidy:main"
source = "https://github.com/cpp-linter/cpp-linter-hooks"
tracker = "https://github.com/cpp-linter/cpp-linter-hooks/issues"

[project.optional-dependencies]
[dependency-groups]
dev = [
"coverage",
"pre-commit",
Expand Down Expand Up @@ -83,4 +82,4 @@ omit = ["tests/*"]
exclude_also = [
"__name__",
"FileNotFoundError"
]
]
4 changes: 2 additions & 2 deletions testing/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ for config in "${configs[@]}"; do
echo "===================================="
echo "Test $config"
echo "===================================="
pre-commit clean
pre-commit run -c testing/$config --files testing/main.c | tee -a result.txt || true
uvx pre-commit clean
uvx pre-commit run -c testing/$config --files testing/main.c | tee -a result.txt || true
git restore testing/main.c
done

Expand Down
Loading
Loading