Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: CI

on:
pull_request:
workflow_dispatch:

jobs:
tests:
runs-on: ubuntu-latest
env:
QUICKXSS_TARGET: "testphp.vulnweb.com"
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"

- name: Install Python dependencies
run: |
set -euo pipefail
echo "Installing Python dependencies..."
python -m pip install -U pip
python -m pip install -e ".[dev]"

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22.x"

- name: Add Go bin to PATH
run: echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"

- name: Install Go tools
run: |
set -euo pipefail
echo "Installing Go tools..."
go install github.com/tomnomnom/gf@latest
go install github.com/tomnomnom/waybackurls@latest
go install github.com/hahwul/dalfox/v2@latest
go install github.com/lc/gau@latest

- name: Install gf patterns
run: |
set -euo pipefail
echo "Installing gf patterns..."
mkdir -p ~/.gf
git clone --depth 1 https://github.com/tomnomnom/gf /tmp/gf
cp -r /tmp/gf/examples/* ~/.gf/
git clone --depth 1 https://github.com/1ndianl33t/Gf-Patterns /tmp/Gf-Patterns
cp -r /tmp/Gf-Patterns/*.json ~/.gf/

- name: Run unit tests
run: |
set -euo pipefail
echo "Running unit tests..."
pytest -m "not integration"

- name: Run integration tests
env:
QUICKXSS_INTEGRATION: "1"
run: |
set -euo pipefail
echo "Running integration tests..."
pytest -m integration
9 changes: 7 additions & 2 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,16 @@ def test_integration_scan(tmp_path: Path) -> None:
"--results-dir",
str(tmp_path),
"--overwrite",
"--quiet",
"--verbose",
"--dalfox-args",
# Limit timeout for faster CI runs and skip headless browser to avoid
# chromedp panics in headless CI environments without Chrome
"--timeout 5 --skip-headless",
],
)

assert result.exit_code == 0
# Include output for debugging CI failures
assert result.exit_code == 0, f"exit_code={result.exit_code}\n{result.output}"

base_dir = tmp_path / domain
urls_file = base_dir / f"{domain}.txt"
Expand Down
Loading