-
Notifications
You must be signed in to change notification settings - Fork 39
77 lines (75 loc) · 2.75 KB
/
proto.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Protobuf Checks
# This workflow runs some Protobuf related checks.
on:
pull_request:
paths:
- "**/**.proto"
- "**/go.mod"
- ".github/workflows/proto.yml"
- "scripts/proto-update-check.sh"
- "scripts/proto-update-deps.sh"
# Set concurrency for this workflow to cancel in-progress jobs if retriggered.
# The github.ref is only available when triggered by a PR so fall back to github.run_id for other cases.
# The github.run_id is unique for each run, giving each such invocation it's own unique concurrency group.
# Basically, if you push to a PR branch, jobs that are still running for that PR will be cancelled.
# But jobs started because of a merge to main or a release tag push are not cancelled.
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
jobs:
buf_lint:
runs-on: ubuntu-latest
name: Protobuf Checks
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Setup Job
id: setup
run: |
branch='main'
if [ -n "$GITHUB_BASE_REF" ]; then
branch="$GITHUB_BASE_REF"
fi
echo "Setting output: base-branch=$branch"
echo "base-branch=$branch" >> "$GITHUB_OUTPUT"
- uses: bufbuild/[email protected]
- uses: bufbuild/[email protected]
if: always()
with:
input: 'proto'
- name: provenance breaking
id: breaking-prov
if: always()
uses: bufbuild/[email protected]
with:
input: 'proto'
against: 'https://github.com/provenance-io/provenance.git#branch=${{ steps.setup.outputs.base-branch }},subdir=proto'
- name: provenance breaking results
if: always() && steps.breaking-prov.outcome == 'failure'
run: |
echo "results:"
echo "${{ toJSON(steps.breaking-prov.outputs) }}"
- name: third-party breaking
id: breaking-third
if: always()
uses: bufbuild/[email protected]
with:
input: 'third_party/proto'
against: 'https://github.com/provenance-io/provenance.git#branch=${{ steps.setup.outputs.base-branch }},subdir=third_party/proto'
- name: third-party breaking results
if: always() && steps.breaking-third.outcome == 'failure'
run: |
echo "results:"
echo "${{ toJSON(steps.breaking-third.outputs) }}"
- name: proto-update-check
if: always()
run: |
BASE_BRANCH="..origin/${{ steps.setup.outputs.base-branch }}"
export BASE_BRANCH
make proto-update-check