forked from openconfig/featureprofiles
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (43 loc) · 1.26 KB
/
protobufs.yml
File metadata and controls
45 lines (43 loc) · 1.26 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
name: Protobufs
on:
push:
branches: [ main ]
pull_request:
schedule:
- cron: "0 0 * * *"
jobs:
validate_protobufs:
name: Validate Protobufs
runs-on: ubuntu-latest
steps:
- name: Install go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Checkout code
uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ github.job }}-${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
- name: Install protobuf
uses: arduino/setup-protoc@v3
with:
version: '23.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Lint protobufs
run: |
go install github.com/googleapis/api-linter/cmd/api-linter@latest
make protoimports
cd protobuf-import
find github.com/openconfig/featureprofiles/ -name \*.proto -exec api-linter --disable-rule all --enable-rule core {} \+
- name: Validate textprotos
run: |
go install github.com/bstoll/textproto-validator@15e24d0eb567d63615f0aa70940bc073ab674fe7
make protoimports
for i in `find . -name \*.textproto`; do
textproto-validator -I ./protobuf-import $i
done