Skip to content

Commit

Permalink
Add CI to run Go unit test. (#1035)
Browse files Browse the repository at this point in the history
Signed-off-by: Syulin7 <[email protected]>
  • Loading branch information
Syulin7 committed Feb 4, 2024
1 parent 3e7e915 commit 23b4fe9
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/unittests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Go Unit Test

on:
- push
- pull_request

jobs:
test:
name: Unit-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: Run Go test
run: |
make test
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,8 @@ ifeq ($(GOLANGCI_LINT),)
endif
golangci-lint run --timeout 5m --go 1.18 ./...

test:
go test ./... -coverprofile cover.out

build-dependabot:
python3 hack/create_dependabot.py

0 comments on commit 23b4fe9

Please sign in to comment.