diff --git a/.github/workflows/unittests.yaml b/.github/workflows/unittests.yaml new file mode 100644 index 000000000..590daade5 --- /dev/null +++ b/.github/workflows/unittests.yaml @@ -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 + diff --git a/Makefile b/Makefile index 852f312b8..14cca247c 100644 --- a/Makefile +++ b/Makefile @@ -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