From f5e0605393aab7bd5603accbd758759ea5550df5 Mon Sep 17 00:00:00 2001 From: Nitzan Pomerantz <9297302+nitzpo@users.noreply.github.com> Date: Sat, 25 Oct 2025 00:53:48 +0300 Subject: [PATCH] Add GitHub Actions CI workflow for PR testing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Runs unit tests with pytest on Python 3.12 - Only triggers on PRs to main branch - Includes code coverage reporting (non-blocking) - Lint checks for code quality (non-blocking) - Integration tests are optional and non-blocking 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/test.yml | 80 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..7ac39e0 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,80 @@ +name: Tests + +on: + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: 'pip' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements-dev.txt + + - name: Run unit tests with coverage + run: | + pytest -v -m "not integration" --cov=nadlan_mcp --cov-report=xml --cov-report=term + continue-on-error: false + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + file: ./coverage.xml + flags: unittests + name: codecov-umbrella + fail_ci_if_error: false + token: ${{ secrets.CODECOV_TOKEN }} + continue-on-error: true + + - name: Run integration tests (if configured) + run: | + pytest -v -m integration || echo "Integration tests skipped (requires API access)" + continue-on-error: true + + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.13" + cache: 'pip' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements-dev.txt + + - name: Run black (check only) + run: | + black --check nadlan_mcp/ tests/ + continue-on-error: true + + - name: Run isort (check only) + run: | + isort --check-only nadlan_mcp/ tests/ + continue-on-error: true + + - name: Run flake8 + run: | + flake8 nadlan_mcp/ tests/ --max-line-length=120 --extend-ignore=E203,W503 + continue-on-error: true + + - name: Run mypy + run: | + mypy nadlan_mcp/ --ignore-missing-imports + continue-on-error: true