From 3532565a9528f71e0433c47c6441db76e414a173 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Mon, 2 Feb 2026 13:07:43 +0000 Subject: [PATCH] fix: verify CI compliance - all tests pass locally --- .gitea/workflows/ci.yml | 70 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 64 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 5024560..607c249 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -2,18 +2,76 @@ name: CI on: push: - branches: [main] + branches: [main, master] pull_request: - branches: [main] + branches: [main, master] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + + - name: Set up Python + uses: actions/setup-python@v5 with: python-version: '3.11' - - run: pip install -e ".[dev]" - - run: pytest tests/ -v - - run: ruff check . + + - name: Cache pip packages + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -e ".[dev]" + pip install pytest-cov + + - name: Download spaCy model + run: python -m spacy download en_core_web_sm + + - name: Lint with Ruff + run: pip install ruff && ruff check src/ tests/ + + - name: Check formatting with Black + run: pip install black && black --check src/ tests/ + + - name: Type check with MyPy + run: pip install mypy && mypy src/ --python-version 3.11 + + - name: Run tests + run: pytest tests/ -v --tb=short + + - name: Run tests with coverage + run: pytest tests/ --cov=src/nl2gherkin --cov-report=term-missing --cov-report=xml + + - name: Upload coverage to Codecov + if: always() + uses: codecov/codecov-action@v4 + with: + files: ./coverage.xml + fail_ci_if_error: false + + build: + runs-on: ubuntu-latest + needs: test + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install build dependencies + run: pip install build + + - name: Build package + run: python -m build + + - name: Verify package + run: pip install dist/*.whl && nl2gherkin --help