mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-09 22:47:24 +00:00
101 lines
2.5 KiB
YAML
101 lines
2.5 KiB
YAML
name: Test Coverage
|
|
on:
|
|
pull_request:
|
|
push:
|
|
paths:
|
|
- "**.go"
|
|
branches:
|
|
- master
|
|
- release/**
|
|
|
|
jobs:
|
|
build-linux:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
goarch: ["arm", "amd64"]
|
|
timeout-minutes: 5
|
|
steps:
|
|
- uses: actions/setup-go@v2
|
|
with:
|
|
go-version: "1.17"
|
|
- uses: actions/checkout@v2.3.4
|
|
- uses: technote-space/get-diff-action@v5
|
|
with:
|
|
PATTERNS: |
|
|
**/**.go
|
|
"!test/"
|
|
go.mod
|
|
go.sum
|
|
Makefile
|
|
- name: install
|
|
run: GOOS=linux GOARCH=${{ matrix.goarch }} make build
|
|
if: "env.GIT_DIFF != ''"
|
|
|
|
tests:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
part: ["00", "01", "02", "03"]
|
|
steps:
|
|
- uses: actions/setup-go@v2
|
|
with:
|
|
go-version: "1.17"
|
|
- uses: actions/checkout@v2.3.4
|
|
- uses: technote-space/get-diff-action@v5
|
|
with:
|
|
PATTERNS: |
|
|
**/**.go
|
|
"!test/"
|
|
go.mod
|
|
go.sum
|
|
Makefile
|
|
- name: test & coverage report creation
|
|
run: |
|
|
make test-group-${{ matrix.part }} NUM_SPLIT=4
|
|
if: env.GIT_DIFF
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: "${{ github.sha }}-${{ matrix.part }}-coverage"
|
|
path: ./build/${{ matrix.part }}.profile.out
|
|
|
|
upload-coverage-report:
|
|
runs-on: ubuntu-latest
|
|
needs: tests
|
|
steps:
|
|
- uses: actions/checkout@v2.3.4
|
|
- uses: technote-space/get-diff-action@v5
|
|
with:
|
|
PATTERNS: |
|
|
**/**.go
|
|
"!test/"
|
|
go.mod
|
|
go.sum
|
|
Makefile
|
|
- uses: actions/download-artifact@v2
|
|
with:
|
|
name: "${{ github.sha }}-00-coverage"
|
|
if: env.GIT_DIFF
|
|
- uses: actions/download-artifact@v2
|
|
with:
|
|
name: "${{ github.sha }}-01-coverage"
|
|
if: env.GIT_DIFF
|
|
- uses: actions/download-artifact@v2
|
|
with:
|
|
name: "${{ github.sha }}-02-coverage"
|
|
if: env.GIT_DIFF
|
|
- uses: actions/download-artifact@v2
|
|
with:
|
|
name: "${{ github.sha }}-03-coverage"
|
|
if: env.GIT_DIFF
|
|
- run: |
|
|
cat ./*profile.out | grep -v "mode: set" >> coverage.txt
|
|
if: env.GIT_DIFF
|
|
- uses: codecov/codecov-action@v2.1.0
|
|
with:
|
|
file: ./coverage.txt
|
|
if: env.GIT_DIFF
|