From 853fadec49116327ec79b395bb342b0ca28a4348 Mon Sep 17 00:00:00 2001 From: Vitor Hugo Date: Thu, 7 Sep 2023 20:21:27 -0300 Subject: [PATCH] :construction_worker: (SETUP) Create CI to test coverage --- .github/workflows/coverage.yaml | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/coverage.yaml diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml new file mode 100644 index 0000000..04b9898 --- /dev/null +++ b/.github/workflows/coverage.yaml @@ -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 \ No newline at end of file