Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix codecov #418

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 15 additions & 38 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: Test and coverage
on:
push:
branches:
Expand All @@ -9,11 +10,7 @@ on:
- master
- dev

name: build

env:
GOPATH: /home/runner/go
GO111MODULE: on

jobs:
testing:
Expand All @@ -24,50 +21,30 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v3

uses: actions/checkout@v4
- name: Install Go
if: success()
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Gather dependencies
run: go mod tidy
- 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)
run: 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
- uses: actions/checkout@v4
- name: Set up Go version to stable
uses: actions/setup-go@v5
with:
go-version: 1.16.x
id: go

- name: Checkout code
uses: actions/checkout@v3

go-version: 'stable'
- name: Gather dependencies
run: go mod tidy
- 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)

run: 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
uses: codecov/codecov-action@v5
with:
token: "282c293b-ab38-4ea6-8518-b44f78df02eb"
file: ./coverage.txt
flags: unittests
name: codecov-umbrella
token: ${{ secrets.CODECOV_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ main/magent*
log/log.test*
go.sum
agent_runtime
test/
test/
coverage.txt
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Motan-go
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/weibocom/motan/blob/master/LICENSE)
[![Build Status](https://img.shields.io/travis/weibocom/motan-go/master.svg?label=Build)](https://travis-ci.org/weibocom/motan-go)
[![codecov](https://codecov.io/gh/weibocom/motan-go/branch/master/graph/badge.svg)](https://codecov.io/gh/weibocom/motan-go)
[![codecov](https://codecov.io/gh/weibocom/motan-go/branch/master/graph/badge.svg?token=2s9DFOt9Y4)](https://codecov.io/gh/weibocom/motan-go)
[![GoDoc](https://godoc.org/github.com/weibocom/motan-go?status.svg&style=flat)](https://godoc.org/github.com/weibocom/motan-go)
[![Go Report Card](https://goreportcard.com/badge/github.com/weibocom/motan-go)](https://goreportcard.com/report/github.com/weibocom/motan-go)

Expand Down
Loading