Skip to content

Commit

Permalink
fix codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanglei28 committed Feb 19, 2025
1 parent be689be commit 6879275
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 41 deletions.
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

0 comments on commit 6879275

Please sign in to comment.