-
Notifications
You must be signed in to change notification settings - Fork 15
79 lines (67 loc) · 2.61 KB
/
verify.yaml
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
78
79
# Copyright 2023 Chainguard, Inc.
# SPDX-License-Identifier: Apache-2.0
name: Verify
on:
pull_request:
branches: [ 'main', 'release-*' ]
push:
branches: [ 'main', 'release-*' ]
jobs:
verify:
name: Verify Codegen
runs-on: ubuntu-latest
env:
GOPATH: ${{ github.workspace }}
steps:
- name: Check out code
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
path: ./src/github.com/${{ github.repository }}
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: './src/github.com/${{ github.repository }}/go.mod'
check-latest: true
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
# In order:
# * Module download cache
# * Build cache (Linux)
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
#- name: Install protoc
# uses: arduino/setup-protoc@v1.1.2
# arduino/setup-protoc@v1.1.2 can't install latest releases of protoc due
# to protoc changing their version naming scheme:
# https://github.com/arduino/setup-protoc/issues/33
- name: Install Protoc
run: |
cd "$(mktemp -d)"
wget -O protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v28.1/protoc-28.1-linux-x86_64.zip
unzip protoc.zip -d .
chmod +x ./bin/protoc
echo "$(pwd)/bin" >> "$GITHUB_PATH"
- name: Install Dependencies
run: |
cd $(mktemp -d)
go install github.com/google/go-licenses@ceb292363ec84358c9a276ef23aa0de893e59b84
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.2
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.5.1
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@v2.22.0
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@v2.22.0
- name: Update Codegen
shell: bash
working-directory: ./src/github.com/${{ github.repository }}
run: |
./hack/update-codegen.sh
- name: Verify
uses: chainguard-dev/actions/nodiff@main
with:
path: ./src/github.com/${{ github.repository }}
fixup-command: "./hack/update-codegen.sh"