Commit 5b75609a authored by Alexader's avatar Alexader

chore(*): add test cover and workflow in github

1. add test cover for coverage report in workflow 2. add workflow for github action
parent c20c7e19
name: build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
lint:
name: Run golanci-lint
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Run golangci-lint
uses: Mushus/golangci-linter@v1
- name: Go report card
uses: creekorful/goreportcard-action@v1.0
test:
name: Run unittest
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.13
- name: Check out code
uses: actions/checkout@v1
- name: Run Unit tests.
run: |
git clone https://github.com/meshplus/pier.git ../pier
export PATH=$PATH:$(go env GOPATH)/bin
make prepare
make test-coverage
# - name: Upload Coverage report to CodeCov
# uses: codecov/codecov-action@v1.0.0
# with:
# token: ${{secrets.CODECOV_TOKEN}}
#file: ./coverage.txt
build:
name: Build project
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Go build
run: |
git clone https://github.com/meshplus/pier.git ../pier
go build -v --buildmode=plugin ./*.go
.DS_Store
build
.idea
\ No newline at end of file
.idea
*.so
*.tar
logs/*
bin
cover.out
cover.html
coverage.txt
......@@ -10,6 +10,11 @@ help: Makefile
prepare:
cd scripts && bash prepare.sh
## make test-coverage: Test project with cover
test-coverage:
@go test -short -coverprofile cover.out -covermode=atomic ${TEST_PKGS}
@cat cover.out >> coverage.txt
## make fabric1.4: build fabric(1.4) client plugin
fabric1.4:
mkdir -p build
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment