Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -21,13 +21,14 @@ 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=${{ 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
name: ${{ matrix.os }}-profile
path: ${{ matrix.os }}-profile
if-no-files-found: error

check-coverage:
runs-on: ubuntu-latest
Expand All @@ -37,23 +38,26 @@ jobs:
- name: checkout
uses: actions/checkout@v4

- name: download cover.ubuntu-latest
uses: actions/download-artifact@v3
- name: download ubuntu-latest-profile
uses: actions/download-artifact@v4
with:
name: cover.ubuntu-latest

- name: download cover.macos-latest
uses: actions/download-artifact@v3
name: ubuntu-latest-profile
- name: download macos-latest-profile
uses: actions/download-artifact@v4
with:
name: cover.macos-latest

name: macos-latest-profile
- name: download windows-latest-profile
uses: actions/download-artifact@v4
with:
name: windows-latest-profile

- 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: ubuntu-latest-profile,macos-latest-profile,windows-latest-profile
git-branch: badges
git-token: ${{ github.ref_name == 'main' && secrets.GITHUB_TOKEN || '' }}

Expand Down
4 changes: 2 additions & 2 deletions pkg/testcoverage/path/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ func NormalizeForOS(path string) string {
return path
}

return strings.ReplaceAll(path, "/", separatorToReplace) // coverage-ignore
return strings.ReplaceAll(path, "/", separatorToReplace)
}

func NormalizeForTool(path string) string {
if runtime.GOOS != "windows" {
return path
}

return strings.ReplaceAll(path, separatorToReplace, "/") // coverage-ignore
return strings.ReplaceAll(path, separatorToReplace, "/")
}
Loading