ci: add modular production workflow pipeline #462#512
ci: add modular production workflow pipeline #462#512somethingwithproof wants to merge 1 commit intoCacti:developfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR modernizes and hardens the repository’s CI/CD posture by adding a modular suite of GitHub Actions workflows for build/test, security scanning, static analysis, coverage, performance regression checks, and release verification—plus supporting scripts and baselines (including an “unsafe C API additions” guardrail).
Changes:
- Adds dedicated workflows for static analysis, security posture, CodeQL, coverage gating, performance regression checks, fuzzing, nightly heavy checks, integration, and release verification.
- Expands the main CI workflow with a multi-OS/multi-sanitizer build+test matrix, portability smoke checks, and an unsafe C API addition guard.
- Introduces helper scripts for SARIF conversion, workflow policy enforcement, leak trend gating, and provides baseline/config files used by these jobs.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/static-analysis.yml | Adds actionlint/shell lint/codespell/clang-tidy/scan-build/cppcheck jobs and SARIF upload. |
| .github/workflows/security-posture.yml | Adds TruffleHog, Semgrep, Scorecard, and workflow policy enforcement. |
| .github/workflows/release-verification.yml | Adds hardened release build verification, ELF hardening checks, SBOM generation, and provenance attestation. |
| .github/workflows/perf-regression.yml | Adds baseline-gated CLI + SNMP performance benchmarking. |
| .github/workflows/nightly.yml | Adds nightly TSAN/ASAN+UBSAN/valgrind/fuzz smoke and leak-trend enforcement. |
| .github/workflows/integration.yml | Adds MariaDB-backed integration job scaffolding and artifact collection. |
| .github/workflows/fuzzing.yml | Adds PR/scheduled CLI argument fuzz smoke using ASAN/UBSAN builds. |
| .github/workflows/coverage.yml | Adds GCC coverage generation + minimum coverage gate and artifacts. |
| .github/workflows/codeql.yml | Adds CodeQL init/build/analyze for c-cpp with scheduled runs. |
| .github/workflows/ci.yml | Reworks CI into a hardened matrix, portability smoke, and unsafe API guard job. |
| .github/scripts/cppcheck_to_sarif.py | Converts cppcheck text output to SARIF for code scanning ingestion. |
| .github/scripts/clang_tidy_to_sarif.py | Converts clang-tidy text output to SARIF for code scanning ingestion. |
| .github/scripts/check-workflow-policy.py | Enforces pinned actions, strict bash settings, and curl-pipe allowlisting. |
| .github/scripts/check-unsafe-api-additions.sh | Blocks newly introduced banned C APIs in diffs. |
| .github/scripts/check-leak-trend.py | Parses sanitizer/valgrind logs and enforces nightly leak baselines. |
| .github/perf-baseline.json | Baselines and thresholds for perf regression gating. |
| .github/nightly-leak-baseline.json | Baselines for sanitizer/valgrind leak trend gating. |
| .github/instructions/instructions.md | Updates contributor/CI guidance and documents the unsafe API guardrail. |
| .github/cppcheck-baseline.txt | Baseline file used to detect cppcheck regressions. |
| .codespell-ignore-words.txt | Adds ignored spelling token(s) for codespell. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| run: | | ||
| set -euo pipefail | ||
| sudo apt-get update | ||
| sudo apt-get install -y golang-go |
There was a problem hiding this comment.
Fixed -- added mkdir -p before go install.
.github/workflows/ci.yml
Outdated
| - name: Gate nightly-only matrix rows | ||
| id: gate | ||
| run: | | ||
| set -euo pipefail | ||
| if [[ "${{ matrix.nightly_only }}" == 'true' && "${{ github.event_name }}" != 'schedule' && "${{ github.event_name }}" != 'workflow_dispatch' ]]; then | ||
| echo "run=false" >> "${GITHUB_OUTPUT}" | ||
| echo "::notice::Skipping nightly-only matrix row for event '${{ github.event_name }}'." | ||
| else | ||
| echo "run=true" >> "${GITHUB_OUTPUT}" | ||
| fi | ||
|
|
There was a problem hiding this comment.
Acknowledged -- will move gating to job-level condition in a follow-up.
| if [[ -n "${GITHUB_BASE_REF:-}" ]]; then | ||
| git fetch --no-tags --depth=1 origin "${GITHUB_BASE_REF}" || true | ||
| base_commit="$(git merge-base HEAD "origin/${GITHUB_BASE_REF}" 2>/dev/null || true)" | ||
| fi | ||
|
|
||
| if [[ -z "${base_commit}" ]]; then | ||
| base_commit="$(git rev-parse HEAD~1 2>/dev/null || git rev-list --max-parents=0 HEAD)" | ||
| fi |
There was a problem hiding this comment.
Fixed -- increased fetch depth for reliable merge-base.
| base_commit="$(git rev-parse HEAD~1 2>/dev/null || git rev-list --max-parents=0 HEAD)" | ||
| fi | ||
|
|
||
| banned_regex='(sprintf|vsprintf|strcpy|strcat|gets)\s*\(' |
There was a problem hiding this comment.
Fixed -- added word boundaries to avoid false positives on fgets/fputs.
|
|
||
| - name: Install actionlint | ||
| run: | | ||
| set -euo pipefail |
There was a problem hiding this comment.
Fixed -- added mkdir -p.
86e5bec to
677f074
Compare
577bac0 to
ba984ab
Compare
c866a3d to
0028985
Compare
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
0028985 to
1fd75e0
Compare
Summary
Replaces the single ci.yml with a comprehensive, modular CI pipeline covering build verification, static analysis, security, coverage, fuzzing, integration testing, and release verification across all supported platforms.
Closes #462
Workflows (10)
On every PR and push
ci.ymlstatic-analysis.ymlcoverage.ymlintegration.ymlcodeql.ymlfuzzing.ymlperf-regression.ymlScheduled
nightly.ymlsecurity-posture.ymlcodeql.ymlOn release tags
release-verification.ymlBuild matrix coverage
Build system fixes
Makefile.am: addednoinst_HEADERSfor dependency tracking,EXTRA_DISTwith all test fixtures and scripts,CLEANFILES,check-unittarget, direct cppcheck (no Docker dependency)configure.ac: removed duplicateAC_PROG_CC, removed deprecatedAC_HEADER_TIME, fixed bash-isms in MySQL detection ([[ ]]->test)Security
set -euo pipefailcontents: readby defaultsecurity-events: writeonly where needed (CodeQL, SARIF upload)