ci: add CI/CD pipelines and deterministic release tooling
Modeled on cflmy/marqdo-cli: - Woodpecker pipeline with fmt/clippy/tests, MSRV 1.89 lane, a lane that builds the pinned core CLI and runs the real Analysis integration tests, and a tag-only release lane - GitHub Actions mirror with the same gates plus artifact upload and prerelease publication - scripts/ci.sh local lanes (test/minimum/core/release/all) - package-release.sh now refuses a dirty tree or SOURCE_SHA mismatch, runs a locked release build and records SOURCE_SHA, RELEASE_INFO.json and SHA-256 - verify-release.sh cold-installs the archive into an isolated MARQDO_TOOL_HOME and runs the documented install/help/compile/query/check/remove smoke path - docs/ci.md and docs/releasing.md document gates, explicit non-gates and the beta freeze/tag procedure
This commit is contained in:
1 parent
66be3e4464
commit
d8d439e6d7
7 files changed
+467
-40
No files matched your search
+90
-11
@@ -1,21 +1,100 @@
|
||||
name: ci
|
||||
on: [push, pull_request]
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
CORE_REPO: https://github.com/cflmy/marqdo-cli
|
||||
CORE_SHA: 4bbefc92449ee480c8a2c89b0308feb4cda8d0e7
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: fmt + clippy + workspace tests
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: "1.89"
|
||||
components: rustfmt, clippy
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- run: cargo fmt --all -- --check
|
||||
- run: cargo clippy --all-targets --locked -- -D warnings
|
||||
- run: cargo clippy --workspace --all-targets --locked -- -D warnings
|
||||
- run: cargo test --workspace --locked
|
||||
- run: cargo build --release --locked
|
||||
# A real core CLI is required for the integration lane; the pinned
|
||||
# release archive and MARQDO_TEST_BIN are configured by the release
|
||||
# environment. Without it, the optional integration tests report a skip.
|
||||
- name: core CLI integration lane
|
||||
if: env.MARQDO_TEST_BIN != ''
|
||||
run: cargo test --test core_cli --test compile
|
||||
|
||||
minimum-rust:
|
||||
name: MSRV check (1.89)
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@1.89
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- run: cargo check --locked --workspace --all-targets
|
||||
|
||||
core-analysis:
|
||||
name: real Analysis integration (pinned core CLI)
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: Build pinned core CLI
|
||||
run: |
|
||||
set -eu
|
||||
git clone --quiet "$CORE_REPO" /tmp/marqdo-cli
|
||||
cd /tmp/marqdo-cli
|
||||
git checkout --quiet "$CORE_SHA"
|
||||
cargo build --release --locked -p marqdo-cli
|
||||
- name: Run integration lane against the real binary
|
||||
env:
|
||||
MARQDO_TEST_BIN: /tmp/marqdo-cli/target/release/marqdo
|
||||
run: |
|
||||
/tmp/marqdo-cli/target/release/marqdo --version
|
||||
cargo test --workspace --locked
|
||||
- name: CLI smoke
|
||||
run: cargo build --locked && target/debug/marqdo-knowledge --help >/dev/null
|
||||
|
||||
release:
|
||||
name: beta release archive
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
needs: [test, minimum-rust, core-analysis]
|
||||
runs-on: ubuntu-24.04
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: Build pinned core CLI
|
||||
run: |
|
||||
set -eu
|
||||
git clone --quiet "$CORE_REPO" /tmp/marqdo-cli
|
||||
cd /tmp/marqdo-cli
|
||||
git checkout --quiet "$CORE_SHA"
|
||||
cargo build --release --locked -p marqdo-cli
|
||||
- name: Package and cold-install smoke
|
||||
env:
|
||||
MARQDO_BIN: /tmp/marqdo-cli/target/release/marqdo
|
||||
SOURCE_SHA: ${{ github.sha }}
|
||||
run: |
|
||||
scripts/package-release.sh
|
||||
scripts/verify-release.sh
|
||||
- name: Upload release archive
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: marqdo-knowledge-beta
|
||||
path: |
|
||||
dist/*.tar.gz
|
||||
dist/*.sha256
|
||||
dist/RELEASE_INFO.json
|
||||
- name: Publish GitHub prerelease
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
prerelease: true
|
||||
files: |
|
||||
dist/*.tar.gz
|
||||
dist/*.sha256
|
||||
dist/RELEASE_INFO.json
|
||||
body_path: docs/releases/0.1.0-beta.1.md
|
||||
Reference in new issue
Block a user