Skip to content

core: stabilize facade API surface, feature taxonomy, and public-api CI gate #5

core: stabilize facade API surface, feature taxonomy, and public-api CI gate

core: stabilize facade API surface, feature taxonomy, and public-api CI gate #5

Workflow file for this run

name: Public API
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
pull-requests: read
env:
CARGO_TERM_COLOR: always
jobs:
snapshot:
name: Snapshot Drift
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-public-api
uses: taiki-e/install-action@v2
with:
tool: cargo-public-api
- name: Generate current snapshots
run: |
cargo +stable public-api --manifest-path crates/rustapi-rs/Cargo.toml -s > /tmp/rustapi-rs.default.txt
cargo +stable public-api --manifest-path crates/rustapi-rs/Cargo.toml --all-features -s > /tmp/rustapi-rs.all-features.txt
- name: Check snapshot drift
run: |
diff -u api/public/rustapi-rs.default.txt /tmp/rustapi-rs.default.txt
diff -u api/public/rustapi-rs.all-features.txt /tmp/rustapi-rs.all-features.txt
label-gate:
name: Label Gate
runs-on: ubuntu-latest
needs: snapshot
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Enforce labels when snapshots change
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.sha }}
PR_LABELS: ${{ join(github.event.pull_request.labels.*.name, ',') }}
run: |
bash .github/scripts/public_api_label_gate.sh