From b661a2f77f1894eefd08ac6309d8d9aa6d8f1bf5 Mon Sep 17 00:00:00 2001 From: Starttoaster Date: Tue, 26 Mar 2024 02:27:30 -0700 Subject: [PATCH 1/4] Add code cov --- .github/workflows/test.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0d1455a..1fa1a4c 100755 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,5 @@ name: Test/Lint/Fmt/Vet + on: pull_request: @@ -15,7 +16,13 @@ jobs: run: go build -o /dev/null ./... - name: Test - run: go test ./... + run: go test ./... -coverprofile=coverage.txt -covermode=atomic + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: Starttoaster/go-proxmox - name: Check gofmt changes run: | From 3cfc697420268ade8c0db60c60317f9261c2a34d Mon Sep 17 00:00:00 2001 From: Starttoaster Date: Tue, 26 Mar 2024 02:31:44 -0700 Subject: [PATCH 2/4] codecov specify files --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1fa1a4c..1c0628a 100755 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,6 +23,7 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} slug: Starttoaster/go-proxmox + files: ./coverage.txt - name: Check gofmt changes run: | From e65715d01a15ae1c9b7a7c2c6dc43008dba2c2f9 Mon Sep 17 00:00:00 2001 From: Starttoaster Date: Tue, 26 Mar 2024 02:34:12 -0700 Subject: [PATCH 3/4] Mark git workspace safe --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1c0628a..5fba0d4 100755 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,9 +7,10 @@ jobs: test: runs-on: ubuntu-latest container: golang:1 - env: - GOFLAGS: "-buildvcs=false" steps: + - name: Mark workspace safe + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + - uses: actions/checkout@v4 - name: Build From 5a0f956dabb80c5666bee33a32c2738037bcf0a7 Mon Sep 17 00:00:00 2001 From: Starttoaster Date: Tue, 26 Mar 2024 02:37:24 -0700 Subject: [PATCH 4/4] Add main trigger --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5fba0d4..7935b8c 100755 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,9 @@ name: Test/Lint/Fmt/Vet on: + push: + branches: + - main pull_request: jobs: