Skip to content
This repository was archived by the owner on Oct 5, 2023. It is now read-only.

Commit b3167a0

Browse files
committed
update .github/workflows/go-test.yml
1 parent 434ac96 commit b3167a0

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

.github/workflows/go-test.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,24 @@ jobs:
2626
run: |
2727
go version
2828
go env
29+
- name: Use msys2 on windows
30+
if: ${{ matrix.os == 'windows' }}
31+
shell: bash
32+
# The executable for msys2 is also called bash.cmd
33+
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md#shells
34+
# If we prepend its location to the PATH
35+
# subsequent 'shell: bash' steps will use msys2 instead of gitbash
36+
run: echo "C:/msys64/usr/bin" >> $GITHUB_PATH
2937
- name: Run repo-specific setup
3038
uses: ./.github/actions/go-test-setup
3139
if: hashFiles('./.github/actions/go-test-setup') != ''
3240
- name: Run tests
3341
uses: protocol/[email protected]
3442
with:
35-
run: go test -v -coverprofile module-coverage.txt ./...
43+
# Use -coverpkg=./..., so that we include cross-package coverage.
44+
# If package ./A imports ./B, and ./A's tests also cover ./B,
45+
# this means ./B's coverage will be significantly higher than 0%.
46+
run: go test -v -coverprofile=module-coverage.txt -coverpkg=./... ./...
3647
- name: Run tests (32 bit)
3748
if: ${{ matrix.os != 'macos' }} # can't run 32 bit tests on OSX.
3849
uses: protocol/[email protected]
@@ -49,7 +60,7 @@ jobs:
4960
shell: bash
5061
run: echo "COVERAGES=$(find . -type f -name 'module-coverage.txt' | tr -s '\n' ',' | sed 's/,$//')" >> $GITHUB_ENV
5162
- name: Upload coverage to Codecov
52-
uses: codecov/codecov-action@51d810878be5422784e86451c0e7c14e5860ec47 # v2.0.2
63+
uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
5364
with:
5465
files: '${{ env.COVERAGES }}'
5566
env_vars: OS=${{ matrix.os }}, GO=${{ matrix.go }}

0 commit comments

Comments
 (0)