mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 13:05:46 +00:00
78dbb59a00
The next time we update the toolchain, all of the CI Actions will automatically use it when go.mod is updated. Signed-off-by: Denton Gentry <dgentry@tailscale.com>
43 lines
954 B
YAML
43 lines
954 B
YAML
name: go generate
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- "release-branch/*"
|
|
pull_request:
|
|
branches:
|
|
- "*"
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: check 'go generate' is clean
|
|
run: |
|
|
if [[ "${{github.ref}}" == release-branch/* ]]
|
|
then
|
|
pkgs=$(go list ./... | grep -v dnsfallback)
|
|
else
|
|
pkgs=$(go list ./... | grep -v dnsfallback)
|
|
fi
|
|
go generate $pkgs
|
|
echo
|
|
echo
|
|
git diff --name-only --exit-code || (echo "The files above need updating. Please run 'go generate'."; exit 1)
|