From cb0df5f10c47fa360f13fed813985f80b60f082e Mon Sep 17 00:00:00 2001 From: Kilian Lieret Date: Tue, 12 Aug 2025 15:30:46 -0400 Subject: [PATCH] CI: Add GHA for pytest --- .github/workflows/pytest.yaml | 48 +++++++++++++++++++++++++++++++++++ pyproject.toml | 3 +++ 2 files changed, 51 insertions(+) create mode 100644 .github/workflows/pytest.yaml diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml new file mode 100644 index 00000000..cdc98575 --- /dev/null +++ b/.github/workflows/pytest.yaml @@ -0,0 +1,48 @@ +name: Pytest + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +on: + push: + branches: + - main + - add-gha + paths-ignore: + - 'docs/**' + - 'README.md' + - '.cursor/**' + - '.github/workflows/build-docs.yaml' + - '.github/workflows/release.yaml' + - '.github/workflows/pylint.yaml' + pull_request: + branches: + - main + paths-ignore: + - 'docs/**' + - 'README.md' + - '.cursor/**' + - '.github/workflows/build-docs.yaml' + - '.github/workflows/release.yaml' + - '.github/workflows/pylint.yaml' + +jobs: + test: + runs-on: ubuntu-latest + defaults: + run: + shell: bash -l {0} + steps: + - name: Checkout code + uses: actions/checkout@v5 + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Install uv + run: | + curl -LsSf https://astral.sh/uv/install.sh | sh + - name: Install dependencies + run: | + uv pip install --python $(which python) -e '.[dev]' + - name: Run pytest + run: pytest -v --cov --cov-branch --cov-report=xml -n auto diff --git a/pyproject.toml b/pyproject.toml index 71e4ddea..bc06ebd8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,6 +31,9 @@ dependencies = [ [project.optional-dependencies] dev = [ "pre-commit", + "pytest", + "pytest-cov", + "pytest-xdist", ] [tool.setuptools.packages.find]