diff --git a/.github/renovate/sync-tool-sha.sh b/.github/renovate/sync-tool-sha.sh index 3581285..78057bd 100644 --- a/.github/renovate/sync-tool-sha.sh +++ b/.github/renovate/sync-tool-sha.sh @@ -6,7 +6,7 @@ set -euo pipefail GITLEAKS_YML=".github/actions/security/gitleaks/action.yml" -SELF_YML=".github/workflows/self.yml" +SELF_YML=".github/workflows/self-lint.yml" DIST_YML=".github/actions/rust/install-dist/action.yml" sha256_of() { diff --git a/.github/workflows/self.yml b/.github/workflows/self-lint.yml similarity index 98% rename from .github/workflows/self.yml rename to .github/workflows/self-lint.yml index 5cde8f8..cca41ad 100644 --- a/.github/workflows/self.yml +++ b/.github/workflows/self-lint.yml @@ -1,5 +1,5 @@ -# Self-CI -name: Self-CI +# Self-CI Lint +name: Self-CI Lint on: push: diff --git a/.github/workflows/self-security.yml b/.github/workflows/self-security.yml index c0ca488..6aaf057 100644 --- a/.github/workflows/self-security.yml +++ b/.github/workflows/self-security.yml @@ -1,8 +1,7 @@ # Self-CI Security name: Self-CI Security -# Local `./` refs so a PR self-tests its own composite changes — the @v0-pinned -# security.yml can't (a reusable workflow's `./` resolves to the caller's checkout). +# Local `./` refs so a PR self-tests its own security composites and workflows. on: push: branches: [main] @@ -25,3 +24,9 @@ jobs: steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - uses: ./.github/actions/security/osv-scanner + + security-gate: + uses: ./.github/workflows/security-gate.yml + + security: + uses: ./.github/workflows/security.yml diff --git a/.github/workflows/self-actions.yml b/.github/workflows/self-test.yml similarity index 94% rename from .github/workflows/self-actions.yml rename to .github/workflows/self-test.yml index e6c3e47..cfe07eb 100644 --- a/.github/workflows/self-actions.yml +++ b/.github/workflows/self-test.yml @@ -1,5 +1,5 @@ -# Self-CI Actions -name: Self-CI Actions +# Self-CI Test +name: Self-CI Test # A PR self-tests its composites via local `./` refs against the real checkout # (GITHUB_SHA == HEAD); `commit-artifacts` pushes to a local bare remote, with @@ -220,3 +220,17 @@ jobs: [ -f "${m}" ] || { echo "::error::javascript/base did not run ${m%-ran}"; exit 1; } done echo "::notice::javascript/base ran install (sfw + frozen lockfile), lint, build, test on the fixture" + + rust-base: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + with: + path: _src + - name: Stage the rust fixture at the workspace root + shell: bash + run: cp -a _src/test/fixtures/rust-crate/. . + - uses: ./_src/.github/actions/rust/base + - name: Confirm rust/base completed the gates + shell: bash + run: echo "::notice::rust/base ran fmt --check, clippy -D warnings, and test on the fixture" diff --git a/.gitignore b/.gitignore index f5a0faa..f64738e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .claude/output/ CLAUDE.local.md node_modules/ +target/ *.log *.bak .actionlint-cache/ diff --git a/CHANGELOG.md b/CHANGELOG.md index e663054..330a3e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## v0.2.1 - 08/06/2026 + +### Refactor +- `self.yml` → `self-lint`, `self-actions` → `self-test` — align the self-CI workflow names (`self-lint` · `self-test` · `self-security` · `self-release`). + +### Tests +- `self-test` — self-test `rust/base` end-to-end on a Rust fixture crate (`test/fixtures/rust-crate`): stage it at the workspace root, run the composite, assert `fmt` / `clippy` / `test` pass. +- `self-security` — self-test the `security-gate.yml` and `security.yml` reusable workflows via local `./` refs, now that `v0` carries the security composites. + +### Documentation +- `README` — add a Self-CI section documenting how the repo tests its own workflows and composites. + +### Configuration +- `.gitignore` — add `target/` for Rust build artifacts. + ## v0.2.0 - 08/06/2026 ### Features diff --git a/CLAUDE.md b/CLAUDE.md index 1897664..d4b7a2c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -13,7 +13,7 @@ Reusable GitHub Actions workflows + composite actions for the Coroboros stack. - `.github/workflows/rust-packages.yml` — bundled Cargo pipeline (`preflight` matrix / `security-gate` / `package` / `publish` / `security`) + opt-in cargo-dist binary layer (`dist-plan` / `dist-build` / `dist-host` / `dist-publish`, gated on `[package.metadata.dist]` or `[workspace.metadata.dist]`). - `.github/workflows/security-gate.yml` — blocking gate `publish` `needs:`. `supply-chain` (auto-routed: `Cargo.toml` → `security/rust/cargo-deny` advisories+bans+sources, else `security/osv-scanner`) + `secret-scan` (gitleaks). A separate reusable workflow so the caller's `publish` can `needs:` the whole gate as one job, running each scan once. Imposed via the package workflows, importable standalone by a non-package repo. - `.github/workflows/security.yml` — advisory layer, never blocks: `dependency-review` (PR-only) + `licenses` (Rust, `continue-on-error`, `security/rust/cargo-deny` `checks: licenses`). License/quality policy lives here, off the gate. -- `.github/workflows/{self,self-security,self-release,self-actions}.yml` — self-CI: lint, gitleaks + osv (composites via local `./`), the `v0` rolling-tag move, and `self-actions` smoke-testing the composites against the real checkout on every PR. +- `.github/workflows/{self-lint,self-test,self-security,self-release}.yml` — self-CI: lint, the security composites + `security-gate`/`security` workflows via local `./`, the `v0` rolling-tag move, and `self-test` smoke-testing every composite (plus `javascript/base`/`rust/base` on `test/fixtures/`) every PR. Workflow self-tests resolve their `@v0` composites against the released `v0`, so a brand-new composite is testable only once a release moves `v0` onto it. - `.github/actions/{check-docs,javascript/base,rust/{base,native-deps,test-deps,install-dist,pin-version},security/{gitleaks,osv-scanner,rust/cargo-deny},release/{verify-tag,generate-changelog,github-release,commit-artifacts}}/action.yml` — composites. - `.github/dependabot.yml` — auto-PRs for pinned action SHAs. `renovate.json` + `.github/workflows/renovate.yml` — self-hosted Renovate (needs the `RENOVATE_TOKEN` PAT secret, scope `repo` + `workflow`) auto-bumps the version-pinned tooling; `.github/renovate/sync-tool-sha.sh` re-syncs each paired tarball SHA-256 in the same PR. - `security/.gitleaks.toml` — canonical gitleaks ruleset. diff --git a/README.md b/README.md index a13690c..ad502d6 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Drop into any `@coroboros/*` repo via `uses: coroboros/ci/.github/workflows/.yml@v0`, or compose around the composite actions under `.github/actions/`. [![latest](https://img.shields.io/github/v/release/coroboros/ci?style=flat-square&label=latest&color=000000)](https://github.com/coroboros/ci/releases) -[![ci](https://img.shields.io/github/actions/workflow/status/coroboros/ci/self.yml?branch=main&style=flat-square&label=ci&color=000000)](https://github.com/coroboros/ci/actions/workflows/self.yml) +[![ci](https://img.shields.io/github/checks-status/coroboros/ci/main?style=flat-square&label=ci&color=000000)](https://github.com/coroboros/ci/actions) [![branch](https://img.shields.io/badge/branch-main-000000?style=flat-square)](https://github.com/coroboros/ci) [![license](https://img.shields.io/badge/license-All%20Rights%20Reserved-000000?style=flat-square)](LICENSE.md) [![stars](https://img.shields.io/github/stars/coroboros/ci?style=flat-square&label=stars&color=000000)](https://github.com/coroboros/ci) @@ -25,6 +25,7 @@ Drop into any `@coroboros/*` repo via `uses: coroboros/ci/.github/workflows/ i32 { + a + b +} + +#[cfg(test)] +mod tests { + use super::add; + + #[test] + fn adds() { + assert_eq!(add(2, 2), 4); + } +}