Skip to content

add codecov

add codecov #16

Workflow file for this run

name: Main
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Build
run: go build -v ./...
- name: Test
run: go test -v -cover ./...
- name: coverage
run: |
COVERAGE=$(go test -cover ./... | awk '{print $5}')
echo "COVERAGE=$(echo ${COVERAGE})" >> $GITHUB_ENV
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Create the Badge
uses: schneegans/dynamic-badges-action@v1.0.0
with:
auth: ${{ secrets.COVERAGE_GIST_SECRET }}
gistID: 720f73912f5b895dcc9b63d2a872cc00
filename: venomoid__${{ env.BRANCH }}.json
label: Test Coverage
message: ${{ env.COVERAGE }}
color: green
namedLogo: jest