Skip to content

Commit

Permalink
👷 (SETUP) Create CI to test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitor Hugo committed Sep 7, 2023
1 parent 13da7ad commit 853fade
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Test coverage

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16
cache-dependency-path: go.sum

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Get dependencies
run: go get -v -t -d ./...

- name: Test
run: go test -v ./... -coverprofile=coverage.txt -covermode=atomic

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt

0 comments on commit 853fade

Please sign in to comment.