Skip to content

Commit

Permalink
Move ci from travis to github actions (kubeflow#164)
Browse files Browse the repository at this point in the history
* Move ci from travis to github actions

* trigger ci on PR
  • Loading branch information
SumLare authored Sep 20, 2021
1 parent 2686188 commit a86572b
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 27 deletions.
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, 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"
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

0 comments on commit a86572b

Please sign in to comment.