Skip to content

ci: consolidate integration test suites into one build + fan-out workflow - #1306

Merged
Wikid82 merged 2 commits into
mainfrom
ci/consolidate-integration-workflows
Sep 8, 2026
Merged

Wikid82 merged 2 commits into
mainfrom
ci/consolidate-integration-workflows

Conversation

@Wikid82

@Wikid82 Wikid82 commented Sep 8, 2026 •

Copy link
Copy Markdown
Owner

What

Consolidates the four near-identical integration-test workflows into a single
.github/workflows/integration-tests.yml that builds the Charon image once
per run and fans out to parallel per-suite test jobs.

Before: cerberus-integration.yml, waf-integration.yml,
rate-limit-integration.yml, crowdsec-integration.yml — four workflows, one
job each, every one of them running ./.github/actions/build-charon-image
independently (~2-4 min same-repo, ~14 min on fork PRs) before its tests.

After: one build job runs the composite action once, docker saves
charon:local and uploads it as a 1-day run-scoped artifact; four suite jobs
(cerberus, waf, rate-limit, crowdsec) needs: build, docker load the
artifact, and run that suite's existing test + debug-dump + cleanup steps
verbatim. Net effect: the image build is paid once instead of 4×, and 3
runner slots are freed for the duration of the build.

Structure

build  (Build Charon image)         — build-charon-image composite ONCE → docker save → upload-artifact (retention 1d)
├── cerberus    (Cerberus Security Stack Integration)   needs: build → download-artifact + docker load → scripts/cerberus_integration.sh
├── waf         (Coraza WAF Integration)                needs: build → download-artifact + docker load → scripts/waf_integration.sh
├── rate-limit  (Rate Limiting Integration)             needs: build → download-artifact + docker load → scripts/rate_limit_integration.sh
└── crowdsec    (CrowdSec Bouncer Integration)          needs: build → download-artifact + docker load → skill-runner integration-test-crowdsec{,-startup}

Four explicit jobs, not a matrix: the suites are not uniform (crowdsec runs
two test suites; cerberus has an extra container-log artifact step; every
debug-dump inspects different ports/containers/volumes; every cleanup removes
different volumes). A matrix would need if: ladders on almost every step —
per the repo guidance, clarity beats DRY here.

Image hand-off mechanism

Uses the repo's existing cross-job pattern from security-pr.yml /
docker-build.yml: docker save + actions/upload-artifact in build,
actions/download-artifact + docker load in each suite job. Because build
and the suite jobs are in the same workflow run, no gh api artifact
hunting is needed (that machinery in security-pr.yml exists only for the
cross-workflow workflow_run hop). No GHCR scratch tag, no packages: write
— the artifact approach has no blocker at this image size with 1-day retention.

Trigger / concurrency

  • Triggers: union of the four — workflow_dispatch + pull_request + push to
    main. (None of the four had paths: filters, so there is nothing to union
    there; all four still ran on every PR.) The unused workflow_dispatch
    image_tag input — declared in all four old workflows but never referenced by
    any step — is dropped.
  • Concurrency: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }},
    cancel-in-progress: true — the four old groups were identical
    (…-${{ github.event.workflow_run.event || github.event_name }}-${{ github.event.workflow_run.head_branch || github.ref }});
    with no workflow_run trigger the workflow_run.* halves are always empty, so
    this is the same group with the dead fallbacks removed.

Timeouts

  • build: timeout-minutes: 20 — unchanged; the fork-PR inline-compile floor
    (~14 min) still applies to the shared build. B6 comment preserved.
  • Suite jobs: cerberus / waf / rate-limit at 12, crowdsec at 15
    (two suites) — the ~14 min inline-compile floor no longer applies to these now
    that the build is upstream; sized for test-only work.

Behavior change to flag for review

scripts/crowdsec_integration.sh (the deprecated wrapper the crowdsec job
reaches via skill-runner integration-test-crowdsec) ran docker build -t charon:local . unconditionally, so the old crowdsec-integration.yml
actually built the image twice (composite + script). It is now guarded behind
docker image inspect charon:local, matching its four sibling scripts
(crowdsec_startup_test.sh, cerberus/waf/rate_limit_integration.sh), so the
job consumes the pre-built artifact. Consequence: the crowdsec suite now runs
against the composite-built image (built with the ci: 'true' build-arg that
crowdsec-integration.yml already passed) rather than a plain script-built one.
Local runs are unaffected (no pre-existing charon:local → still builds).

The shared build job passes ci: 'true' (crowdsec's old value; the other
three passed the default 'false'). The CI build-arg only makes the GeoLite2
download fail-fast instead of retrying — no test-surface impact for waf /
cerberus / rate-limit.

No test or service/container was dropped. Every suite's test steps, debug-dump
step and cleanup step are copied across unchanged.

⚠️ Required-status-check rename (maintainer action)

The four old workflows' check names disappear and reappear as jobs under the new
Integration Tests workflow. Branch protection for main and development
must be updated
— the check names themselves are unchanged, but the
identifying workflow is not, so GitHub treats them as new checks:

Old check (workflow) New check (workflow)
Cerberus Security Stack Integration (Cerberus Integration) Cerberus Security Stack Integration (Integration Tests)
Coraza WAF Integration (WAF integration) Coraza WAF Integration (Integration Tests)
Rate Limiting Integration (Rate Limit integration) Rate Limiting Integration (Integration Tests)
CrowdSec Bouncer Integration (CrowdSec Integration) CrowdSec Bouncer Integration (Integration Tests)
(new) Build Charon image (Integration Tests) — add as required

Notes

Adds .github/workflows/integration-tests.yml, which builds the Charon image
a single time via the shared build-charon-image composite action, uploads it
as a 1-day run-scoped artifact, then fans out to parallel per-suite test jobs
(cerberus / waf / rate-limit / crowdsec) that `docker load` that image instead
of rebuilding it. Replaces four near-identical standalone workflows that each
paid the image-build cost independently.

Each suite job keeps its own test steps, debug-dump-on-failure and cleanup
verbatim (each inspects different containers/ports/volumes). Job/check names
are preserved so the diff is reviewable, but they now live under one workflow.

Also guards the unconditional `docker build` in scripts/crowdsec_integration.sh
behind a `docker image inspect charon:local` check, matching the sibling
scripts (crowdsec_startup_test.sh, cerberus/waf/rate_limit_integration.sh) so
the crowdsec job actually consumes the pre-built artifact rather than
rebuilding the image a second time.

Claude-Session: https://claude.ai/code/session_01KXA4x9LrA2AsnLrvdHMZbS
Points docs and instructions that named the four deleted workflow files
(cerberus-integration.yml / waf-integration.yml / rate-limit-integration.yml /
crowdsec-integration.yml) at .github/workflows/integration-tests.yml and its
per-suite jobs instead.

Claude-Session: https://claude.ai/code/session_01KXA4x9LrA2AsnLrvdHMZbS
@github-advanced-security

Copy link
Copy Markdown
Contributor

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@codecov

codecov Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

✅ Supply Chain Verification Results

✅ PASSED

📦 SBOM Summary

  • Components: 1769

🔍 Vulnerability Scan

Severity Count
🔴 Critical 0
🟠 High 0
🟡 Medium 0
🟢 Low 0
Total 0

📎 Artifacts

  • SBOM (CycloneDX JSON) and Grype results available in workflow artifacts

Generated by Supply Chain Verification workflow • View Details

@Wikid82
Wikid82 marked this pull request as ready for review September 8, 2026 07:46
@Wikid82
Wikid82 marked this pull request as draft September 8, 2026 07:52
@Wikid82
Wikid82 marked this pull request as ready for review September 8, 2026 07:55
@Wikid82
Wikid82 merged commit 255a23d into main Sep 8, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants