From 5563b3b9eb8e789b151e665b214a84be6bb3082b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vlado=20Paji=C4=87?= Date: Sat, 16 Nov 2024 22:34:41 +0100 Subject: [PATCH 1/9] add windows test runner --- .github/workflows/test.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 83ceac2d..e9b492bf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, windows-latest] steps: - name: checkout @@ -41,19 +41,22 @@ jobs: uses: actions/download-artifact@v3 with: name: cover.ubuntu-latest - - name: download cover.macos-latest uses: actions/download-artifact@v3 with: name: cover.macos-latest - + - name: download cover.windows-latest + uses: actions/download-artifact@v3 + with: + name: cover.windows-latest + - name: check test coverage id: coverage uses: vladopajic/go-test-coverage@v2 continue-on-error: true # Should fail after coverage comment is posted with: config: ./.github/.testcoverage.yml - profile: cover.ubuntu-latest.profile,cover.macos-latest.profile + profile: cover.ubuntu-latest.profile,cover.macos-latest.profile,cover.windows-latest.profile git-branch: badges git-token: ${{ github.ref_name == 'main' && secrets.GITHUB_TOKEN || '' }} From 1914336004db3d85346426eac98c867bd856e4cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vlado=20Paji=C4=87?= Date: Sun, 17 Nov 2024 15:45:02 +0100 Subject: [PATCH 2/9] remove timeout for windows --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e9b492bf..13999938 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: - name: test env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed for GitHub badge storer integration test - run: go test -timeout=60s -race -count=1 -failfast -shuffle=on ./... -coverprofile=./cover.${{ matrix.os }}.profile -covermode=atomic -coverpkg=./... + run: go test -race -count=1 -failfast -shuffle=on ./... -coverprofile=./cover.${{ matrix.os }}.profile -covermode=atomic -coverpkg=./... - name: upload cover profile artifact uses: actions/upload-artifact@v3 From 143b48d8407d716d085bf9aae98aec4a3261a01b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vlado=20Paji=C4=87?= Date: Sun, 17 Nov 2024 15:49:08 +0100 Subject: [PATCH 3/9] latest upload/download artifact actions --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 13999938..0da102f0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,7 @@ jobs: run: go test -race -count=1 -failfast -shuffle=on ./... -coverprofile=./cover.${{ matrix.os }}.profile -covermode=atomic -coverpkg=./... - name: upload cover profile artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: cover.${{ matrix.os }} path: cover.${{ matrix.os }}.profile @@ -38,15 +38,15 @@ jobs: uses: actions/checkout@v4 - name: download cover.ubuntu-latest - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: cover.ubuntu-latest - name: download cover.macos-latest - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: cover.macos-latest - name: download cover.windows-latest - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: cover.windows-latest From a3907747e9ffd8c121b17b2140a626a84fa445ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vlado=20Paji=C4=87?= Date: Sun, 17 Nov 2024 15:59:29 +0100 Subject: [PATCH 4/9] add if-no-files-found --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0da102f0..6bd99af7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,6 +28,7 @@ jobs: with: name: cover.${{ matrix.os }} path: cover.${{ matrix.os }}.profile + if-no-files-found: error check-coverage: runs-on: ubuntu-latest From 4331120be304720e96abc7ca2be459da34730d27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vlado=20Paji=C4=87?= Date: Sun, 17 Nov 2024 16:00:22 +0100 Subject: [PATCH 5/9] fix test command --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6bd99af7..fca9b078 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: - name: test env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed for GitHub badge storer integration test - run: go test -race -count=1 -failfast -shuffle=on ./... -coverprofile=./cover.${{ matrix.os }}.profile -covermode=atomic -coverpkg=./... + run: go test -race -count=1 -failfast -shuffle=on -coverprofile=./cover.${{ matrix.os }}.profile -covermode=atomic -coverpkg=./... ./... - name: upload cover profile artifact uses: actions/upload-artifact@v4 From e940231b27d8f3f735fa38f19545e06c98930a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vlado=20Paji=C4=87?= Date: Sun, 17 Nov 2024 16:02:08 +0100 Subject: [PATCH 6/9] fix test cmd --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fca9b078..50da2b7c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: - name: test env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed for GitHub badge storer integration test - run: go test -race -count=1 -failfast -shuffle=on -coverprofile=./cover.${{ matrix.os }}.profile -covermode=atomic -coverpkg=./... ./... + run: go test -race -count=1 -failfast -shuffle=on -coverprofile=cover.${{ matrix.os }}.profile -covermode=atomic -coverpkg=./... ./... - name: upload cover profile artifact uses: actions/upload-artifact@v4 From 075dc1c79f07e862066fdf5c0c8a31665b1c8f6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vlado=20Paji=C4=87?= Date: Sun, 17 Nov 2024 16:05:52 +0100 Subject: [PATCH 7/9] update --- .github/workflows/test.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 50da2b7c..bffa6374 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,13 +21,13 @@ jobs: - name: test env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed for GitHub badge storer integration test - run: go test -race -count=1 -failfast -shuffle=on -coverprofile=cover.${{ matrix.os }}.profile -covermode=atomic -coverpkg=./... ./... + run: go test -race -count=1 -failfast -shuffle=on -coverprofile=${{ matrix.os }}.profile -covermode=atomic -coverpkg=./... ./... - name: upload cover profile artifact uses: actions/upload-artifact@v4 with: - name: cover.${{ matrix.os }} - path: cover.${{ matrix.os }}.profile + name: ${{ matrix.os }}.profile + path: ${{ matrix.os }}.profile if-no-files-found: error check-coverage: @@ -38,18 +38,18 @@ jobs: - name: checkout uses: actions/checkout@v4 - - name: download cover.ubuntu-latest + - name: download ubuntu-latest.profile uses: actions/download-artifact@v4 with: - name: cover.ubuntu-latest - - name: download cover.macos-latest + name: ubuntu-latest.profile + - name: download macos-latest.profile uses: actions/download-artifact@v4 with: - name: cover.macos-latest - - name: download cover.windows-latest + name: macos-latest.profile + - name: download windows-latest.profile uses: actions/download-artifact@v4 with: - name: cover.windows-latest + name: windows-latest.profile - name: check test coverage id: coverage @@ -57,7 +57,7 @@ jobs: continue-on-error: true # Should fail after coverage comment is posted with: config: ./.github/.testcoverage.yml - profile: cover.ubuntu-latest.profile,cover.macos-latest.profile,cover.windows-latest.profile + profile: ubuntu-latest.profile,macos-latest.profile,windows-latest.profile git-branch: badges git-token: ${{ github.ref_name == 'main' && secrets.GITHUB_TOKEN || '' }} From cd6054f01d85bc9a3988ec6ef351936aa7bf4be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vlado=20Paji=C4=87?= Date: Sun, 17 Nov 2024 16:10:14 +0100 Subject: [PATCH 8/9] fix profile names --- .github/workflows/test.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bffa6374..b310439f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,13 +21,13 @@ jobs: - name: test env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed for GitHub badge storer integration test - run: go test -race -count=1 -failfast -shuffle=on -coverprofile=${{ matrix.os }}.profile -covermode=atomic -coverpkg=./... ./... + run: go test -race -count=1 -failfast -shuffle=on -coverprofile=${{ matrix.os }}-profile -covermode=atomic -coverpkg=./... ./... - name: upload cover profile artifact uses: actions/upload-artifact@v4 with: - name: ${{ matrix.os }}.profile - path: ${{ matrix.os }}.profile + name: ${{ matrix.os }}-profile + path: ${{ matrix.os }}-profile if-no-files-found: error check-coverage: @@ -38,18 +38,18 @@ jobs: - name: checkout uses: actions/checkout@v4 - - name: download ubuntu-latest.profile + - name: download ubuntu-latest-profile uses: actions/download-artifact@v4 with: - name: ubuntu-latest.profile - - name: download macos-latest.profile + name: ubuntu-latest-profile + - name: download macos-latest-profile uses: actions/download-artifact@v4 with: - name: macos-latest.profile - - name: download windows-latest.profile + name: macos-latest-profile + - name: download windows-latest-profile uses: actions/download-artifact@v4 with: - name: windows-latest.profile + name: windows-latest-profile - name: check test coverage id: coverage @@ -57,7 +57,7 @@ jobs: continue-on-error: true # Should fail after coverage comment is posted with: config: ./.github/.testcoverage.yml - profile: ubuntu-latest.profile,macos-latest.profile,windows-latest.profile + profile: ubuntu-latest-profile,macos-latest-profile,windows-latest-profile git-branch: badges git-token: ${{ github.ref_name == 'main' && secrets.GITHUB_TOKEN || '' }} From 1373e34fbd4753a537d8c62cabfd4157dbf270b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vlado=20Paji=C4=87?= Date: Sun, 17 Nov 2024 16:14:54 +0100 Subject: [PATCH 9/9] remove coverage ignore --- pkg/testcoverage/path/path.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/testcoverage/path/path.go b/pkg/testcoverage/path/path.go index a9a1c175..13226022 100644 --- a/pkg/testcoverage/path/path.go +++ b/pkg/testcoverage/path/path.go @@ -13,7 +13,7 @@ func NormalizeForOS(path string) string { return path } - return strings.ReplaceAll(path, "/", separatorToReplace) // coverage-ignore + return strings.ReplaceAll(path, "/", separatorToReplace) } func NormalizeForTool(path string) string { @@ -21,5 +21,5 @@ func NormalizeForTool(path string) string { return path } - return strings.ReplaceAll(path, separatorToReplace, "/") // coverage-ignore + return strings.ReplaceAll(path, separatorToReplace, "/") }