Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Move ci from travis to github actions #164

Merged
merged 2 commits into from
Sep 20, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
on: push
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can not remember the default behavior here. Without specifying the ref, does it by default

  1. fetch HEAD for pull_request?
  2. fetch master for push

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The branch, tag or SHA to checkout. When checking out the repository that
triggered a workflow, this defaults to the reference or SHA for that event.
Otherwise, uses the default branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok yeah, as per docs:

  1. pull_request -> Last merge commit on the GITHUB_REF branch (master)
  2. push -> Commit pushed


- 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"
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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(...)
...
Expand Down