-
Notifications
You must be signed in to change notification settings - Fork 706
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI to run the tests for Go (#1440)
* add test for Go to CI Signed-off-by: tenzen-y <[email protected]> * fix golangci-lint errors Signed-off-by: tenzen-y <[email protected]> * fix Go test * fix coverage report file name Signed-off-by: tenzen-y <[email protected]> * use Go 1.17 Signed-off-by: tenzen-y <[email protected]> * fix error comments Signed-off-by: tenzen-y <[email protected]> * fix coverage badge in readme Signed-off-by: tenzen-y <[email protected]> * fix e2e test Signed-off-by: tenzen-y <[email protected]> * skip testServerImage Signed-off-by: tenzen-y <[email protected]> * fix e2e test PATH Signed-off-by: tenzen-y <[email protected]>
- Loading branch information
Showing
33 changed files
with
179 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Go Test | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
env: | ||
GOPATH: ${{ github.workspace }}/go | ||
defaults: | ||
run: | ||
working-directory: ${{ env.GOPATH }}/src/github.com/kubeflow/training-operator | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
with: | ||
path: ${{ env.GOPATH }}/src/github.com/kubeflow/training-operator | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17.1 | ||
|
||
- name: Check Go modules | ||
run: | | ||
go mod tidy && git add go.* | ||
git diff --cached --exit-code || (echo 'Please run "go mod tidy" to sync Go modules' && exit1); | ||
- name: Check manifests | ||
run: | | ||
make manifests && git add manifests | ||
git diff --cached --exit-code || (echo 'Please run "make manifests" to generate manifests' && exit1); | ||
- name: Check auto-generated codes | ||
run: | | ||
make generate && git add pkg/apis | ||
git diff --cached --exit-code || (echo 'Please run "make generate" to generate Go codes' && exit1); | ||
- name: Verify gofmt | ||
run: | | ||
make fmt && git add pkg cmd | ||
git diff --cached --exit-code || (echo 'Please run "make fmt" to verify gofmt' && exit1); | ||
- name: Verify govet | ||
run: | | ||
make vet && git add pkg cmd | ||
git diff --cached --exit-code || (echo 'Please run "make vet" to verify govet' && exit1); | ||
- name: Run Go test | ||
run: make test | ||
- name: Coveralls report | ||
uses: shogo82148/actions-goveralls@v1 | ||
with: | ||
path-to-profile: cover.out | ||
working-directory: ${{ env.GOPATH }}/src/github.com/kubeflow/training-operator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ bin/ | |
/tf-operator | ||
vendor/ | ||
testbin/* | ||
cover.out | ||
|
||
# IDEs | ||
.vscode/ | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.