-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (47 loc) · 1.55 KB
/
public-api.yml
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:
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: check API 🌐
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Install nightly & cargo-public-api
run: |
set -euxo pipefail
rustup install nightly-2024-10-11 --profile minimal
mv ~/.rustup/toolchains/nightly-2024-10-11-x86_64-unknown-linux-gnu ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu
- name: Install public-api
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-public-api
locked: true
- name: Checkout
uses: actions/checkout@v4
- name: Check API
run: |
echo "Commit: ${{ github.event.pull_request.head.sha }}" > api_diff.txt
echo "\`\`\`rust" >> api_diff.txt
cargo public-api diff >> api_diff.txt
echo "\`\`\`" >> api_diff.txt
cat api_diff.txt
- name: Find Comment
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
- name: Create / update comment
if: ${{ github.event.pull_request }}
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body-path: api_diff.txt
token: ${{ secrets.GITHUB_TOKEN }}
edit-mode: replace