-
Notifications
You must be signed in to change notification settings - Fork 397
36 lines (32 loc) · 1.03 KB
/
build_template.yml
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
on:
workflow_call:
inputs:
modulepath:
required: true
type: string
go-version:
required: true
type: string
jobs:
generated:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-version }}
- name: Check generated files are up to date
working-directory: ${{ inputs.modulepath }}
run: |
if make -qp | grep -q '^generate:'; then
make generate
if [ "$(git status -s)" != "" ]; then
echo "command 'make generate' creates files that differ from the git tree, please run 'make generate' and commit:"
git status -s
exit 1
fi
else
echo "'make generate' rule not found, skipping."
fi