From 1b13407ceeee19aceba3cbf9b0a6b49a5267c9b0 Mon Sep 17 00:00:00 2001 From: Masaaki Goshima Date: Wed, 30 Dec 2020 17:55:52 +0900 Subject: [PATCH 1/2] Measure coverage --- .github/workflows/go.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index e22d1b4..fe2ddf1 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -19,7 +19,11 @@ jobs: uses: actions/checkout@v2 - name: Test - run: go test -v ./ -count=1 + run: go test -v -coverprofile=coverage.out ./ -count=1 + + - name: Report coverage + run: | + bash <(curl -s https://codecov.io/bash) # - name: Test with GC # run: go test -v ./ -count=1 From 00886d93f1ce7549f00f823984c2b286897a0952 Mon Sep 17 00:00:00 2001 From: Masaaki Goshima Date: Wed, 30 Dec 2020 18:06:43 +0900 Subject: [PATCH 2/2] Add coverage job --- .github/workflows/go.yml | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index fe2ddf1..bff6800 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,7 +1,7 @@ name: Go on: [push, pull_request] jobs: - build: + test: name: Test strategy: matrix: @@ -13,17 +13,12 @@ jobs: uses: actions/setup-go@v2 with: go-version: ${{ matrix.go-version }} - id: go - name: Check out code into the Go module directory uses: actions/checkout@v2 - name: Test - run: go test -v -coverprofile=coverage.out ./ -count=1 - - - name: Report coverage - run: | - bash <(curl -s https://codecov.io/bash) + run: go test -v ./ -count=1 # - name: Test with GC # run: go test -v ./ -count=1 @@ -32,3 +27,18 @@ jobs: # - name: Test with race detector # run: go test -v -race ./ -count=1 + coverage: + name: Coverage + runs-on: ubuntu-latest + steps: + - name: setup Go + uses: actions/setup-go@v2 + with: + go-version: 1.15 + - name: checkout + uses: actions/checkout@v2 + - name: measure coverage + run: go test -v -coverprofile=coverage.out ./ -count=1 + - name: report coverage + run: | + bash <(curl -s https://codecov.io/bash)