Skip to content

Commit

Permalink
enable github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
cofyc committed Feb 13, 2020
1 parent 8dbb9b5 commit b991bf6
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 12 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: ci

on:
pull_request:
branches:
- master
- release-*

jobs:

verify:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v1
with:
fetch-depth: 1
path: go/src/github.com/pingcap/tidb-operator

- name: Verify
run: |
# workaround for https://github.com/actions/setup-go/issues/14
export GOPATH=/home/runner/work/tidb-operator/go
export PATH=$PATH:$GOPATH/bin
make check-setup
make check
- name: Build
run: make docker e2e-docker cli
- name: Test
run: make test GOFLAGS='-race'
25 changes: 13 additions & 12 deletions ci/pingcap_tidb_operator_build_kind.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,17 @@ def call(BUILD_BRANCH, CREDENTIALS_ID, CODECOV_CREDENTIALS_ID) {
}
}

stage("Check") {
ansiColor('xterm') {
sh """
export GOPATH=${WORKSPACE}/go
export PATH=${WORKSPACE}/go/bin:\$PATH
make check-setup
make check
"""
}
}
// moved to Github Actions
// stage("Check") {
// ansiColor('xterm') {
// sh """
// export GOPATH=${WORKSPACE}/go
// export PATH=${WORKSPACE}/go/bin:\$PATH
// make check-setup
// make check
// """
// }
// }

stage("Build and Test") {
ansiColor('xterm') {
Expand All @@ -209,10 +210,10 @@ def call(BUILD_BRANCH, CREDENTIALS_ID, CODECOV_CREDENTIALS_ID) {
make e2e-build
if [ ${BUILD_BRANCH} == "master" ]
then
make test GO_COVER=y
make test GOFLAGS='-race' GO_COVER=y
curl -s https://codecov.io/bash | bash -s - -t ${CODECOV_TOKEN} || echo 'Codecov did not collect coverage reports'
else
make test
make test GOFLAGS='-race'
fi
"""
}
Expand Down

0 comments on commit b991bf6

Please sign in to comment.