-
-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (47 loc) · 1.5 KB
/
public-api.yml
File metadata and controls
57 lines (47 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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