Files
hate_crack/.github/workflows/ci.yml
T
Justin BollingerandClaude Opus 4.7 f3b6e04a3b build: unblock ty 0.0.63 dep bump
ty 0.0.63 changed two things that broke CI on this bump:
- new rules (unsupported-operator, no-matching-overload,
  invalid-assignment, unresolved-global) are error-severity by
  default and fire on the same legacy module-globals pattern in
  hate_crack/main.py the existing "warn" rules were pinned for;
  downgrade them to match.
- default exit behaviour now fails on warning-level diagnostics;
  pass --exit-zero-on-warning to ty check in CI and in the pre-push
  prek hook to restore the prior fail-only-on-errors semantics.

No source changes; deferring the main.py globals refactor.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-27 13:57:06 -04:00

98 lines
3.0 KiB
YAML

name: CI
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
checks:
name: Lint, type-check, and tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# tests/test_main_pcfg.py needs pcfg_cracker/pcfg_guesser.py on disk
submodules: true
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
python-version: "3.13"
enable-cache: true
cache-dependency-glob: "**/uv.lock"
- name: Install dependencies
run: uv sync --dev
- name: Ruff (lint)
run: uv run ruff check hate_crack
- name: Ruff (format)
run: uv run ruff format --check hate_crack
- name: Ty
# ty 0.0.63 fails CI on warning-level diagnostics by default;
# keep the pre-0.0.63 behaviour of failing only on errors so the
# rules already downgraded to "warn" in [tool.ty.rules] stay
# non-blocking.
run: uv run ty check --exit-zero-on-warning hate_crack
- name: Pytest
env:
HATE_CRACK_SKIP_INIT: "1"
run: uv run pytest -q
# Bandit SAST against the committed baseline (.bandit-baseline.json): only
# findings NOT already in the baseline fail the build. hate_crack shells out
# to hashcat extensively, so the baseline captures the reviewed low-severity
# subprocess/shlex findings. Config lives in [tool.bandit] in pyproject.toml.
bandit:
name: Bandit SAST
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Bandit (vs baseline)
run: >-
uvx --from "bandit[toml]==1.9.4" bandit
-r hate_crack -c pyproject.toml -b .bandit-baseline.json
# pip-audit: fail on dependencies with known CVEs (PyPI / OSV advisory DB).
# Audits the synced project environment. PYSEC-2026-2447 (diskcache 5.6.3, a
# transitive dep via instructor -> atomic-agents) is ignored because no fixed
# release exists upstream; revisit when diskcache ships a fix.
pip-audit:
name: pip-audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
python-version: "3.13"
enable-cache: true
cache-dependency-glob: "**/uv.lock"
- name: Install dependencies
run: uv sync
- name: Audit dependencies
run: >-
uv run --with pip-audit==2.10.0 pip-audit
--progress-spinner off --ignore-vuln PYSEC-2026-2447