From 8ef6c1cba28205380b5875d050d92fa15a0d2b0a Mon Sep 17 00:00:00 2001 From: Justin Bollinger Date: Fri, 6 Feb 2026 09:46:26 -0500 Subject: [PATCH] ci: add multi-version Python testing and status banners - Separate lint job for ruff and mypy checks on Python 3.13 - Add pytest matrix strategy to test Python 3.9 through 3.14 - Add GitHub Actions status badge to README - Document CI/CD pipeline and what each check does - Include pass/fail criteria for linting, type checking, and testing - Link to Actions tab for detailed workflow results --- .github/workflows/tests.yml | 34 +++++++++++++++++++++++++++------- README.md | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7a46bb5..9080536 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,8 +5,34 @@ on: pull_request: jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.13" + + - name: Install uv + run: python -m pip install --upgrade pip uv==0.9.28 + + - name: Install dev dependencies + run: | + uv venv .venv + uv pip install --python .venv/bin/python ".[dev]" + + - name: Run ruff + run: .venv/bin/ruff check hate_crack + + - name: Run mypy + run: .venv/bin/mypy hate_crack + pytest: runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v4 with: @@ -14,7 +40,7 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: "3.13" + python-version: ${{ matrix.python-version }} - name: Install system dependencies run: sudo apt-get update && sudo apt-get install -y p7zip-full transmission-cli @@ -27,12 +53,6 @@ jobs: uv venv .venv uv pip install --python .venv/bin/python ".[dev]" - - name: Run ruff - run: .venv/bin/ruff check hate_crack - - - name: Run mypy - run: .venv/bin/mypy hate_crack - - name: Run tests env: HATE_CRACK_RUN_E2E: "0" diff --git a/README.md b/README.md index 8c314f6..03eb368 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,15 @@ \/ \/ \/_____/ \/ \/ \/ \/ ``` +## Status + +[![tests](https://github.com/trustedsec/hate_crack/actions/workflows/tests.yml/badge.svg)](https://github.com/trustedsec/hate_crack/actions/workflows/tests.yml) + +**CI/CD Checks:** +- **Linting (Ruff)** - Code quality and formatting validation +- **Type Checking (Mypy)** - Static type analysis +- **Testing** - Python 3.9, 3.10, 3.11, 3.12, 3.13, 3.14 + ## Installation ### 1. Install hashcat @@ -229,6 +238,33 @@ Install the project with optional dev dependencies (includes type stubs, linters pip install -e ".[dev]" ``` +### Continuous Integration + +The project uses GitHub Actions to automatically run quality checks on every push and pull request. + +**Checks that run on each commit:** + +1. **Linting (Ruff)** - Code style and quality validation + - ✅ **PASS**: Code follows style rules and best practices + - ❌ **FAIL**: Code has style violations or quality issues + - Run locally: `make ruff` + +2. **Type Checking (Mypy)** - Static type analysis + - ✅ **PASS**: No type errors detected + - ❌ **FAIL**: Type mismatches or missing annotations found + - Run locally: `make mypy` + +3. **Testing (Multi-Version)** - Tests across Python 3.9 through 3.14 + - ✅ **PASS**: All tests pass on all supported Python versions + - ⚠️ **PARTIAL**: Tests pass on some versions but fail on others + - ❌ **FAIL**: Tests fail on one or more Python versions + - Run locally: `make test` + +**View CI/CD Status:** +- Click the badge above to see the full test results +- Each workflow shows which Python version(s) failed or passed +- Details are available in the Actions tab + ### Running Linters and Type Checks Before pushing changes, run these checks locally to catch issues early: