forked from opendatahub-io/trainer
-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (69 loc) · 2.15 KB
/
test-go.yaml
File metadata and controls
79 lines (69 loc) · 2.15 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Unit and Integration Test - Go
on:
- push
- pull_request
jobs:
generate:
name: Generate
runs-on: ubuntu-latest
env:
GOPATH: ${{ github.workspace }}/go
defaults:
run:
working-directory: ${{ env.GOPATH }}/src/github.com/kubeflow/trainer
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
path: ${{ env.GOPATH }}/src/github.com/kubeflow/trainer
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: ${{ env.GOPATH }}/src/github.com/kubeflow/trainer/go.mod
- name: Check Go modules
run: |
go mod tidy
git diff --exit-code || (echo 'Please run "go mod tidy" to sync Go modules' && exit 1);
- name: Check auto-generated assets
run: |
make generate
git diff --exit-code || (echo 'Please run "make generate" to generate assets' && exit 1);
- name: Check go fmt
run: |
make fmt
git diff --exit-code || (echo 'Please run "make fmt" to verify gofmt' && exit 1);
- name: Check go fmt
run: |
make vet
git diff --exit-code || (echo 'Please run "make vet" to verify govet' && exit 1);
- name: Check golangci lint
run: |
make golangci-lint
test:
name: Test
runs-on: ubuntu-latest
env:
GOPATH: ${{ github.workspace }}/go
defaults:
run:
working-directory: ${{ env.GOPATH }}/src/github.com/kubeflow/trainer
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
path: ${{ env.GOPATH }}/src/github.com/kubeflow/trainer
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: ${{ env.GOPATH }}/src/github.com/kubeflow/trainer/go.mod
- name: Run Go unit tests
run: |
make test
- name: Run Go integration tests
run: |
make test-integration
- name: Coveralls report
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: cover.out
working-directory: ${{ env.GOPATH }}/src/github.com/kubeflow/trainer