mirror of
https://github.com/nearai/ironclaw.git
synced 2026-09-03 08:06:01 +08:00
* ci: speed up feedback loop — concurrency, dynamic matrix, path skip, faster staging - Add cancel-in-progress concurrency groups to 6 workflows (test, code_style, e2e, regression-test-check, pr-label-classify, pr-label-scope) so pushes to the same branch cancel stale CI runs instead of queuing behind them. - Collapse test/clippy matrix on PRs from 3 configs to 1 (all-features). Full 3-config matrix still runs on staging promotion and push-to-main. Cuts PR compilation from ~3x to ~1x. - Reduce staging-ci poll interval from 60 minutes to 10 minutes, cutting worst-case promotion latency by 6x. - Add path-based skip to test.yml and code_style.yml: a lightweight changes-detection job checks if any code files changed (src/, crates/, Cargo.*, etc.). Docs-only PRs skip all Rust compilation while the rollup job still passes for branch protection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test: collapse nested ifs in trace_contains_tool_call match arms Clippy 1.95 added/tightened `clippy::collapsible_match`. The two nested `if`s in this helper are equivalent to additional match-arm guards, which is what the lint suggests. No behavior change. Inherited from #2268's merge into staging; would have failed `Clippy (all-features)` on every PR until fixed. * test: rustfmt struct destructure in collapsed match arm * ci: drop --benches from clippy invocations `--benches` pulls in `criterion` (heavy dep) but only covers 2 bench files in `crates/ironclaw_safety/`. Lints rarely differ in bench code, and `bench-compile` in test.yml already provides the type-check signal. Cold-cache impact: ~30s+ saved per Linux/Windows leg (criterion + plotters + ciborium chain). Warm-cache: marginal but non-zero. --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: ilblackdragon@gmail.com <ilblackdragon@gmail.com>
123 lines
4.5 KiB
YAML
123 lines
4.5 KiB
YAML
name: E2E Tests
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
ref:
|
|
description: Commit SHA or ref to test
|
|
required: false
|
|
type: string
|
|
schedule:
|
|
- cron: "0 6 * * 1" # Weekly Monday 6 AM UTC
|
|
workflow_dispatch:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "src/channels/web/**"
|
|
- "tests/e2e/**"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: e2e-${{ github.head_ref || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
# ── Step 1: compile once ──────────────────────────────────────────────────
|
|
build:
|
|
name: Build ironclaw (libsql)
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
with:
|
|
ref: ${{ inputs.ref || github.sha }}
|
|
persist-credentials: false
|
|
|
|
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
|
|
|
|
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
|
|
with:
|
|
path: |
|
|
target
|
|
~/.cargo/registry
|
|
key: e2e-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
|
|
|
|
- name: Build
|
|
run: cargo build --no-default-features --features libsql
|
|
|
|
- name: Upload binary
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
|
with:
|
|
name: ironclaw-e2e-binary
|
|
path: target/debug/ironclaw
|
|
retention-days: 1
|
|
|
|
# ── Step 2: run test slices in parallel ───────────────────────────────────
|
|
test:
|
|
name: E2E (${{ matrix.group }})
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- group: core
|
|
files: "tests/e2e/scenarios/test_connection.py tests/e2e/scenarios/test_chat.py tests/e2e/scenarios/test_sse_reconnect.py tests/e2e/scenarios/test_html_injection.py tests/e2e/scenarios/test_csp.py"
|
|
- group: features
|
|
files: "tests/e2e/scenarios/test_skills.py tests/e2e/scenarios/test_tool_approval.py tests/e2e/scenarios/test_webhook.py"
|
|
- group: extensions
|
|
files: "tests/e2e/scenarios/test_extensions.py tests/e2e/scenarios/test_extension_oauth.py tests/e2e/scenarios/test_oauth_url_parameters.py tests/e2e/scenarios/test_telegram_token_validation.py tests/e2e/scenarios/test_telegram_hot_activation.py tests/e2e/scenarios/test_wasm_lifecycle.py tests/e2e/scenarios/test_tool_execution.py tests/e2e/scenarios/test_agent_loop_recovery.py tests/e2e/scenarios/test_pairing.py tests/e2e/scenarios/test_mcp_auth_flow.py tests/e2e/scenarios/test_oauth_credential_fallback.py tests/e2e/scenarios/test_routine_oauth_credential_injection.py"
|
|
- group: routines
|
|
files: "tests/e2e/scenarios/test_owner_scope.py tests/e2e/scenarios/test_routine_event_batch.py"
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
with:
|
|
ref: ${{ inputs.ref || github.sha }}
|
|
persist-credentials: false
|
|
|
|
- name: Download binary
|
|
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
|
|
with:
|
|
name: ironclaw-e2e-binary
|
|
path: target/debug/
|
|
|
|
- name: Make binary executable
|
|
run: chmod +x target/debug/ironclaw
|
|
|
|
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Install E2E dependencies
|
|
run: |
|
|
cd tests/e2e
|
|
pip install -e .
|
|
playwright install --with-deps chromium
|
|
|
|
- name: Run E2E tests (${{ matrix.group }})
|
|
run: pytest ${{ matrix.files }} -v --timeout=120
|
|
|
|
- name: Upload screenshots on failure
|
|
if: failure()
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
|
with:
|
|
name: e2e-screenshots-${{ matrix.group }}
|
|
path: tests/e2e/screenshots/
|
|
if-no-files-found: ignore
|
|
|
|
# ── Roll-up for branch protection ────────────────────────────────────────
|
|
e2e:
|
|
name: E2E Tests
|
|
runs-on: ubuntu-latest
|
|
if: always()
|
|
needs: [test]
|
|
steps:
|
|
- run: |
|
|
if [[ "${{ needs.test.result }}" != "success" ]]; then
|
|
echo "One or more E2E jobs failed"
|
|
exit 1
|
|
fi
|