Files
marqdo-knowledge/.github/workflows/ci.yml
T
marqdo-knowledge d8d439e6d7 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
2026-11-26 09:01:13 +08:00

101 lines
3.0 KiB
YAML

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:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all -- --check
- run: cargo clippy --workspace --all-targets --locked -- -D warnings
- run: cargo test --workspace --locked
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