Skip to content

Commit

Permalink
Add CI to run the tests for Go.
Browse files Browse the repository at this point in the history
Signed-off-by: Syulin7 <[email protected]>
  • Loading branch information
Syulin7 committed Jan 19, 2024
1 parent 1449e75 commit 1e97810
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 15 deletions.
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, check our contributor guidelines: https://www.kubeflow.org/docs/about/contributing
2. To know more about Arena, check the developer guide:
https://arena-docs.readthedocs.io/en/latest/
3. If you want *faster* PR reviews, check how: https://git.k8s.io/community/contributors/guide/pull-requests.md#best-practices-for-faster-reviews
-->

**What this PR does / why we need it**:

**Which issue(s) this PR fixes** _(optional, in `Fixes #<issue number>, #<issue number>, ...` format, will close the issue(s) when PR gets merged)_:
Fixes #
42 changes: 42 additions & 0 deletions .github/workflows/test-go.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Go generate 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/arena

steps:
- name: Check out code
uses: actions/checkout@v3
with:
path: ${{ env.GOPATH }}/src/github.com/kubeflow/arena

- name: Setup Go
uses: actions/setup-go@v3
with:
go-version-file: ${{ env.GOPATH }}/src/github.com/kubeflow/arena/go.mod

- 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' && exit 1);
- name: Verify gofmt
run: |
make fmt && git add pkg cmd &&
git diff --cached --exit-code || (echo 'Please run "make fmt" to verify gofmt' && exit 1);
- name: Verify govet
run: |
make vet && git add pkg cmd &&
git diff --cached --exit-code || (echo 'Please run "make vet" to verify govet' && exit 1);
- name: Verify golint
run: |
make golangci-lint
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ go 1.18
require (
github.com/docker/docker v20.10.12+incompatible
github.com/golang/glog v1.0.0
github.com/golang/protobuf v1.5.3
github.com/google/uuid v1.3.0
github.com/kserve/kserve v0.10.0
github.com/mitchellh/go-homedir v1.1.0
Expand All @@ -16,6 +15,7 @@ require (
github.com/spf13/viper v1.10.0
github.com/stretchr/testify v1.8.1
golang.org/x/crypto v0.0.0-20220214200702-86341886e292
google.golang.org/protobuf v1.28.1
gopkg.in/yaml.v2 v2.4.0
istio.io/api v0.0.0-20200715212100-dbf5277541ef
k8s.io/api v0.23.9
Expand Down Expand Up @@ -54,6 +54,7 @@ require (
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/go-containerregistry v0.8.1-0.20220414143355-892d7a808387 // indirect
Expand Down Expand Up @@ -113,7 +114,6 @@ require (
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959 // indirect
google.golang.org/grpc v1.48.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.66.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
13 changes: 0 additions & 13 deletions license.txt

This file was deleted.

0 comments on commit 1e97810

Please sign in to comment.