generated from caicloud/golang-template-project
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Use github actions to run ut and e2e test (#76)
Signed-off-by: Ce Gao <gaoce.gaoc@bytedance.com>
- Loading branch information
Ce Gao
committed
Aug 28, 2020
1 parent
896d963
commit 9467671
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: CI | ||
|
||
# Controls when the action will run. Triggers the workflow on push or pull request | ||
# events but only for the master branch | ||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
model-registry-unit-test: | ||
runs-on: | ||
#- self-hosted | ||
- ubuntu-latest | ||
timeout-minutes: 60 | ||
steps: | ||
- name: Set up Go 1.14 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.14.7 | ||
id: go | ||
- uses: actions/checkout@v2 | ||
with: | ||
path: src/github.com/kleveross/klever-model-registry | ||
- name: before_install | ||
run: | | ||
# get coveralls.io support | ||
go get github.com/mattn/goveralls | ||
# install kubebuilder | ||
wget https://github.com/kubernetes-sigs/kubebuilder/releases/download/v2.3.1/kubebuilder_2.3.1_linux_amd64.tar.gz | ||
tar -zxvf kubebuilder_2.3.1_linux_amd64.tar.gz | ||
mv kubebuilder_2.3.1_linux_amd64 kubebuilder | ||
sudo mv kubebuilder /usr/local | ||
- name: install | ||
run: | | ||
make build | ||
- name: script | ||
run: | | ||
GO_COVER_PROFILE=$(mktemp -u) | ||
go test ./pkg/... -race -covermode atomic -coverprofile $GO_COVER_PROFILE | ||
goveralls -service=travis-ci -coverprofile $GO_COVER_PROFILE |