diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 000000000..5c56f6f5a --- /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 6eeb0f2d2..d96ff5264 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /bats /cmd/hcloud/hcloud hcloud_cli.p12 +coverage.txt