Repository navigation
ci: run the test suite on pull requests via GitHub Actions - #39
Merged
Merged
Conversation
Adds .github/workflows/ci.yml, triggered on pull_request and on pushes to main. The suite runs on Python 3.8-3.13 (every version pyproject claims to support) on Ubuntu, plus Python 3.12 on macOS to cover the termios/stty paths the tool is developed against. nmap is installed on the Ubuntu jobs: tests/test_nse_integration.py skips the whole module when nmap is absent, so without it the NSE assertions would look green without ever running. The 95% coverage floor is not restated in the workflow - it already comes from pytest's addopts in pyproject.toml, so a coverage regression fails the test step. A uv lock --check step catches a pyproject change that was not locked. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds GitHub Actions CI so pull requests get an automated signal instead of relying on a local
pytestrun.What runs
.github/workflows/ci.yml, onpull_requestand on pushes tomain:ubuntu-latest— every versionpyproject.tomldeclares viarequires-python = ">=3.8". Older versions come from uv's managed interpreters, so no version is skipped just because the runner image lacks it.macos-latest— the tool is developed on macOS and has its owntermios/sttyhandling, so a Linux-only matrix would leave that untested.uv lock --check— catches apyproject.tomlchange that was never locked.uv run --frozen pytest tests/ -v— the same command used locally.nmapis installed on the Ubuntu jobs.tests/test_nse_integration.pyskips its entire module whennmapis absent, so without that step the NSE assertions would report green without ever executing.Concurrency is keyed on the PR head ref with
cancel-in-progress, so a new push supersedes the previous run rather than queueing behind it.permissions: contents: readonly.The 95% coverage floor is deliberately not restated in the workflow — it already comes from
addoptsin[tool.pytest.ini_options], so a coverage regression fails the test step and there is only one place to change the threshold.Verification
Locally, in a clean worktree off
main:actionlint .github/workflows/ci.yml→ 0 errorsuv lock --check→ lock in syncuv run --frozen pytest tests/ -q→ 907 passed, 5 skipped, 99.91% coverageuv run --frozen --python 3.8 pytest tests/ -q→ 907 passed, 5 skipped (confirms the oldest matrix entry resolves and passes)The 5 skips are the expected environment gates: NSE cases whose local port was occupied, and the
-sUcase that needs root.Note on the open PRs
Workflows run from the head branch of a PR, so #37 and #38 will not show checks until they pick up
mainafter this merges.Also worth flagging separately: the push output surfaced a Dependabot alert on this repo (https://github.com/trustedsec/spoonmap/security/dependabot/2) — unrelated to this change, but visible now.
Docs
## Developmentsection covering how to run the suite, the coverage floor, and why an NSE skip is an environment conflict rather than a failure.CLAUDE.md: a short paragraph describing what CI covers.