Skip to content

Zero Breach — local, read-only scanner that checks a computer for indicators of the AdFection / Candiru ad-delivered spyware campaign. No network, no admin, no dependencies.

Enable CI: run tests + a real --quick scan on Windows, macOS and Linux

interplains23ae9fcafaa6
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
new file mode 100644
index 0000000..e766f0c
--- /dev/null
+++ b/.github/workflows/tests.yml
@@ -0,0 +1,63 @@
+name: tests
+
+on:
+ push:
+ branches: [main]
+ pull_request:
+ workflow_dispatch:
+
+jobs:
+ test:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ # The tool targets Windows first, but the browser and file checks run on
+ # macOS and Linux too, so the suite runs on all three.
+ os: [ubuntu-latest, windows-latest, macos-latest]
+ python-version: ["3.8", "3.11", "3.12"]
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v5
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Run the test suite (standard library only, no install step)
+ working-directory: scan
+ run: python -m unittest discover -s tests -v
+
+ smoke-scan:
+ # Prove the scan itself runs end to end on real hardware for each OS, not
+ # just the unit tests. The runners have no real browser data, so the result
+ # is an honest "nothing found / with gaps" - the point is that it executes
+ # and exits cleanly (0 = nothing found) without crashing on that platform.
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ubuntu-latest, windows-latest, macos-latest]
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
+ with:
+ python-version: "3.12"
+ - name: Run a real --quick scan and require a clean exit
+ working-directory: scan
+ run: python -X utf8 adint-scan.py --quick --json scan.json
+
+ reproducible-build:
+ # The build must be deterministic and the committed artifacts up to date, so
+ # anyone can rebuild zero-breach.py from source and get the published file.
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
+ with:
+ python-version: "3.11"
+ - name: Rebuild everything and fail on drift
+ run: python build/build.py --check
+ - name: Confirm two builds are byte-identical
+ run: |
+ python build/bundle.py . /tmp/a.py
+ python build/bundle.py . /tmp/b.py
+ cmp /tmp/a.py /tmp/b.py && echo "reproducible build OK"
diff --git a/.gitignore b/.gitignore
index 4bbe8b6..a24a1fe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,6 +27,3 @@ HANDOVER.md
DESIGN.md
SPEC-scanner.md
-# CI workflow: held out of git until the GitHub token has the `workflow` scope
-# (grant with: gh auth refresh -s workflow), then remove this line and add it.
-.github/workflows/tests.yml