-
Notifications
You must be signed in to change notification settings - Fork 22
38 lines (36 loc) · 879 Bytes
/
ci.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
37
38
name: ci
on:
pull_request:
branches: [master]
push:
branches: [master]
workflow_run:
workflows: [image]
types: [completed]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: magnetikonline/action-golang-cache@v3
with: {go-version-file: go.mod}
- run: make test
- run: go tool cover -func coverall.out
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: magnetikonline/action-golang-cache@v3
with: {go-version-file: go.mod}
- run: make clean && make generate
- name: Ensure generated code is already checked in
if: success()
run: |
files="$(git diff --name-only)"
if [ -z "$files" ]; then exit 0; fi
echo "Files with diffs:"
echo "$files"
echo
echo
git diff
exit 1