2021-07-12 22:02:45 +00:00
|
|
|
name: go generate
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- "release-branch/*"
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- "*"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
check:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Set up Go
|
2022-03-16 19:46:16 +00:00
|
|
|
uses: actions/setup-go@v3
|
2021-07-12 22:02:45 +00:00
|
|
|
with:
|
2022-03-15 22:58:54 +00:00
|
|
|
go-version: 1.18
|
2021-07-12 22:02:45 +00:00
|
|
|
|
|
|
|
- name: Check out code
|
2022-03-22 22:56:34 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-07-12 22:02:45 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: check 'go generate' is clean
|
2022-03-17 22:18:45 +00:00
|
|
|
# The shell script invocation below is a temporary hack for
|
|
|
|
# https://github.com/tailscale/tailscale/issues/4194. When
|
|
|
|
# that issue is fixed, replace its invocation with:
|
|
|
|
# go generate --tags=hermetic ./...
|
2021-07-12 22:02:45 +00:00
|
|
|
run: |
|
2022-03-17 22:18:45 +00:00
|
|
|
set -e
|
|
|
|
./.github/workflows/go-generate-without-stringer.sh
|
2021-07-12 22:02:45 +00:00
|
|
|
echo
|
|
|
|
echo
|
|
|
|
git diff --name-only --exit-code || (echo "The files above need updating. Please run 'go generate'."; exit 1)
|