From b3a45aa9f298bc2ebeff7b697f6b0d22af066749 Mon Sep 17 00:00:00 2001 From: pauhull Date: Tue, 14 Nov 2023 11:06:02 +0100 Subject: [PATCH] ci: add Codecov to check test coverage --- .github/workflows/codecov.yml | 26 ++++++++++++++++++++++++++ .gitignore | 1 + 2 files changed, 27 insertions(+) create mode 100644 .github/workflows/codecov.yml diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 00000000..5c56f6f5 --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,26 @@ +name: Codecov CI + +on: + push: + branches: [main] + pull_request: + +jobs: + codecov: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: "1.21" + + - name: Generate coverage report ./... + run: go test -coverprofile=coverage.txt + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore index 6eeb0f2d..d96ff526 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /bats /cmd/hcloud/hcloud hcloud_cli.p12 +coverage.txt