From b229a9b27c4d190ee57ef685f90d05823f2d9641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Zaffarano?= Date: Mon, 20 Sep 2021 22:14:49 +0200 Subject: [PATCH 1/2] 5: Integrate with codecov.io --- .github/workflows/ci.yaml | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b7509f6..706deb2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,8 +10,8 @@ on: - "**" jobs: - lint: - name: Lint + build: + name: CI build runs-on: ubuntu-latest steps: - name: Install Go @@ -20,13 +20,23 @@ jobs: go-version: 1.17.x - name: Checkout code uses: actions/checkout@v2 + - name: Build project + run: go build . - name: Run linters uses: golangci/golangci-lint-action@v2 - test: + - name: Test with coverage + run: go test -v -coverprofile=coverage.txt -covermode=atomic ./... + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + + multiplat-tests: + name: Test in other platforms strategy: matrix: go-version: [1.17.x] - platform: [ubuntu-latest, macos-latest, windows-latest] + platform: [macos-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: - name: Install Go @@ -37,20 +47,4 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - name: Run tests - run: go test -v -covermode=count ./... - - coverage: - runs-on: ubuntu-latest - steps: - - name: Install Go - if: success() - uses: actions/setup-go@v2 - with: - go-version: 1.17.x - - name: Checkout code - uses: actions/checkout@v2 - - name: Calc coverage - run: | - go test -v -covermode=count -coverprofile=coverage.out ./... - - name: Convert coverage.out to coverage.lcov - uses: jandelgado/gcov2lcov-action@v1.0.8 + run: go test -v ./... From ff2b013787d768d6b44c61028aa81040e51b57fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Zaffarano?= Date: Mon, 20 Sep 2021 22:19:35 +0200 Subject: [PATCH 2/2] 5: Add codecov.io badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2233790..e06a0e0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ [![Build Status](https://github.com/szaffarano/gotas/workflows/Go%20CI/badge.svg)](https://github.com/szaffarano/gotas/actions?workflow=Go%20CI) [![Go Report Card](https://goreportcard.com/badge/github.com/szaffarano/gotas)](https://goreportcard.com/report/github.com/szaffarano/gotas) +[![codecov](https://codecov.io/gh/szaffarano/gotas/branch/master/graph/badge.svg?token=8UPQNA4E34)](https://codecov.io/gh/szaffarano/gotas) # Gotas