Skip to content

Merge pull request #100 from chainguard-dev/create-pull-request/patch #415

Merge pull request #100 from chainguard-dev/create-pull-request/patch

Merge pull request #100 from chainguard-dev/create-pull-request/patch #415

Workflow file for this run

# Copyright 2023 Chainguard, Inc.
# SPDX-License-Identifier: Apache-2.0
name: Verify
on:
pull_request:
branches: [ 'main', 'release-*' ]
push:
branches: [ 'main', 'release-*' ]
permissions: {}
jobs:
verify:
name: Verify Codegen
runs-on: ubuntu-latest
permissions:
contents: read
env:
GOPATH: ${{ github.workspace }}
steps:
- name: Check out code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: ./src/github.com/${{ github.repository }}
fetch-depth: 0
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
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@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
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/[email protected]
# arduino/[email protected] 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/v29.3/protoc-29.3-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/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
go install github.com/grpc-ecosystem/grpc-gateway/v2/[email protected]
go install github.com/grpc-ecosystem/grpc-gateway/v2/[email protected]
- name: Update Codegen
shell: bash
working-directory: ./src/github.com/${{ github.repository }}
run: |
./hack/update-codegen.sh
- name: Verify
uses: chainguard-dev/actions/nodiff@5363dd9eb48083bbf7674a4bbe62d71c3b230edd # v1.1.2
with:
path: ./src/github.com/${{ github.repository }}
fixup-command: "./hack/update-codegen.sh"