1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: CI
on:
push:
branches:
pull_request:
branches:
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install Chrome
run: |
sudo apt-get update
sudo apt-get install -y google-chrome-stable
- name: Run unit + property + chaos + wirings tests
run: cargo test --workspace --lib --test property_detect --test property_solver --test property_frame --test property_behavior --test property_token_shapes --test property_frame_graph --test property_audio_dsp --test property_mouse_sampler --test chaos_resilience --test snapshot_structures --test wirings --test community_rules
- name: Run CLI URL-guard tests (SSRF defence)
run: cargo test -p captchaforge-cli --bin captchaforge url_guard
- name: Run integration tests (ignored / real browser)
run: cargo test --test integration -- --ignored --test-threads=1
env:
CHROME_BIN: /usr/bin/google-chrome
lint:
name: Lint & Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt -- --check
- name: Run clippy
run: cargo clippy --workspace -- -D warnings
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build docs
run: cargo doc --workspace --no-deps
- name: Check doc warnings
run: cargo doc --workspace --no-deps 2>&1 | grep -i warning && exit 1 || true
msrv:
name: MSRV (1.85)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.85
- uses: Swatinem/rust-cache@v2
- name: Build with MSRV
run: cargo build --workspace --all-targets
deny:
name: cargo deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check advisories bans sources licenses
bench-smoke:
name: Bench Smoke Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install Chrome
run: |
sudo apt-get update
sudo apt-get install -y google-chrome-stable
- name: Run anti-detection bench
run: cd bench && cargo run -- --suite anti-detection
- name: Run shadow-dom bench
run: cd bench && cargo run -- --suite shadow-dom