Skip to content

Commit

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

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

jobs:

pull:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- "check-setup check"
- "docker e2e-docker cli"
- "test GOFLAGS=-race"
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: make ${{ matrix.target }}
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 $target
env:
target: ${{ matrix.target }}
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 24cfc29

Please sign in to comment.