-
Notifications
You must be signed in to change notification settings - Fork 1.8k
47 lines (45 loc) · 1.27 KB
/
apidiff.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
name: API Compatibility
on:
merge_group:
push:
branches:
- main
paths-ignore:
- '**/*.md'
pull_request:
branches:
- "**"
paths-ignore:
- '**/*.md'
permissions:
contents: read # for actions/checkout to fetch code
jobs:
apidiff:
runs-on: ubuntu-latest
if: github.base_ref
steps:
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: 1.23.x
- name: Add GOBIN to PATH
run: echo "$(go env GOPATH)/bin" >>$GITHUB_PATH
- name: Install apidiff cmd
run: go install golang.org/x/exp/cmd/[email protected]
- name: Checkout base code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ github.base_ref }}
path: "base"
persist-credentials: false
- name: Capture apidiff baseline
run: apidiff -m -w ../baseline.bin .
working-directory: "base"
- name: Checkout updated code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
path: "updated"
persist-credentials: false
- name: Run apidiff check
run: apidiff -m -incompatible ../baseline.bin .
working-directory: "updated"