diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..dcd0fe7e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,50 @@ +on: [push, pull_request] +name: Build +jobs: + test: + runs-on: ubuntu-latest + env: + GOPATH: ${{ github.workspace }} + GO111MODULE: on + defaults: + run: + working-directory: ${{ env.GOPATH }}/src/github.com/kubeflow/common + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 1 + path: ${{ env.GOPATH }}/src/github.com/kubeflow/common + + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: 1.16 + + - uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: Build + run: | + ./hack/verify-gomod.sh + ./hack/verify-codegen.sh + go build ./... + go fmt ./... + + - name: Install dependencies + run: | + # get coveralls.io support + go get github.com/mattn/goveralls + # Install golangci-lint + curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin + + - name: Test + run: | + golangci-lint run --config=linter_config.yaml ./... + # Here we run all tests in pkg and we have to use `-ignore` + # since goveralls uses `filepath.Match` to match ignore files + # and it does not support patterns like `**`. + goveralls -service=github -v -package ./... -ignore "test_job/client/*/*.go,test_job/client/*/*/*.go,test_job/client/*/*/*/*.go,test_job/client/*/*/*/*/*.go,test_job/client/*/*/*/*/*/*.go,test_job/client/*/*/*/*/*/*/*.go,test_job/testutil/*.go,test_job/*/*/*/zz_generated.*.go,test_job/*/*/*/*_generated.go,pkg/apis/common/*/zz_generated.*.go,pkg/apis/common/*/*_generated.go" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b2f5926f..00000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: go -dist: focal -go: - - "1.16.x" -env: - - GO111MODULE=on -go_import_path: github.com/kubeflow/common - -install: - # get coveralls.io support - - go get github.com/mattn/goveralls - # Install golangci-lint - - curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin - -script: - - ./hack/verify-gomod.sh - - ./hack/verify-codegen.sh - - go build ./... - - go fmt ./... - - golangci-lint run --config=linter_config.yaml ./... - # Here we run all tests in pkg and we have to use `-ignore` - # since goveralls uses `filepath.Match` to match ignore files - # and it does not support patterns like `**`. - - goveralls -service=travis-ci -v -package ./... -ignore "test_job/client/*/*.go,test_job/client/*/*/*.go,test_job/client/*/*/*/*.go,test_job/client/*/*/*/*/*.go,test_job/client/*/*/*/*/*/*.go,test_job/client/*/*/*/*/*/*/*.go,test_job/testutil/*.go,test_job/*/*/*/zz_generated.*.go,test_job/*/*/*/*_generated.go,pkg/apis/common/*/zz_generated.*.go,pkg/apis/common/*/*_generated.go" diff --git a/README.md b/README.md index d057b0f1..704343dd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Kubeflow common for operators +# Kubeflow common for operators -[![Build Status](https://travis-ci.com/kubeflow/common.svg?branch=master)](https://travis-ci.com/kubeflow/common/) +[![Build Status](https://github.com/kubeflow/common/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/kubeflow/common/actions/?query=workflow%3ABuild) [![Go Report Card](https://goreportcard.com/badge/github.com/kubeflow/common)](https://goreportcard.com/report/github.com/kubeflow/common) This repo contains the libraries for writing a custom job operators such as tf-operator and pytorch-operator. @@ -39,7 +39,7 @@ jobController := common.JobController { - Within you main reconcile loop, call the [JobController.ReconcileJobs](pkg/controller.v1/common/job.go) method. ```go reconcile(...) { - // Your main reconcile loop. + // Your main reconcile loop. ... jobController.ReconcileJobs(...) ...