-
Notifications
You must be signed in to change notification settings - Fork 18
43 lines (41 loc) · 1.26 KB
/
main.yaml
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
39
40
41
42
43
name: Workflow for Jenkins Client
on:
push:
branches:
- main
pull_request:
branches:
- 'main'
jobs:
LintAndTest:
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.23
uses: actions/[email protected]
with:
go-version: 1.23
- uses: actions/checkout@v2
# See also https://github.com/GoogleCloudPlatform/golang-samples/blob/78dfa41f10b449ba7a06d9793cbd81878d44a4fb/.github/workflows/go.yaml#L29-L53
- name: Run go mod tidy on root modules
run: go mod tidy
# If there are any diffs from go mod tidy, fail.
- name: Verify no changes from go mod tidy.
run: |
if [ -n "$(git status --porcelain)" ]; then
echo 'To fix this check, run "go mod tidy"'
git diff
git status # Show the files that failed to pass the check.
exit 1
fi
- name: Run make fmt on root modules
run: make fmt
- name: Verify on changes from make fmt
run: |
if [ -n "$(git status --porcelain)" ]; then
echo 'To fix this check, run "make fmt"'
git diff
git status # Show the files that failed to pass the check.
exit 1
fi
- name: test
run: make test