Merge pull request #396 from Hoofffman/export_get_context #478
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
on: | |
push: | |
branches: | |
- master | |
- dev | |
- dev_fix | |
pull_request: | |
branches: | |
- master | |
- dev | |
name: build | |
env: | |
GOPATH: /home/runner/go | |
GO111MODULE: on | |
jobs: | |
testing: | |
strategy: | |
matrix: | |
go-version: [1.16.x,1.17.x,1.18.x,1.19.x,1.20.x,1.21.x] | |
platform: [ubuntu-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Go | |
if: success() | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Run tests | |
run: | | |
echo "GOPATH >>> $GOPATH" | |
echo "pwd >>> $PWD" | |
mkdir -p $GOPATH/src/github.com/weibocom/ | |
cp -R ../motan-go $GOPATH/src/github.com/weibocom/ | |
cd $GOPATH/src/github.com/weibocom/motan-go | |
go mod tidy | |
go test -v -race $(go list ./... | grep -v main) | |
codecov: | |
name: codecov | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.16 | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.16.x | |
id: go | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Generate coverage report | |
run: | | |
echo "GOPATH >>> $GOPATH" | |
echo "pwd >>> $PWD" | |
mkdir -p $GOPATH/src/github.com/weibocom/ | |
cp -R ../motan-go $GOPATH/src/github.com/weibocom/ | |
cd $GOPATH/src/github.com/weibocom/motan-go | |
go mod tidy | |
go test -v -race -coverprofile=coverage.txt -covermode=atomic $(go list ./... | grep -v main) | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v1.0.2 | |
with: | |
token: "282c293b-ab38-4ea6-8518-b44f78df02eb" | |
file: ./coverage.txt | |
flags: unittests | |
name: codecov-umbrella |