Skip to content

Commit

Permalink
Run coverage on Linux and Windows and upload to Codecov using flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Mirić committed Oct 12, 2020
1 parent cd6c20d commit 0b8ecaf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
10 changes: 10 additions & 0 deletions .codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,13 @@ coverage:
default:
target: auto
threshold: 0.3%
windows:
target: auto
flags: [windows]
ubuntu:
target: auto
flags: [ubuntu]

flags:
windows:
ubuntu:
14 changes: 6 additions & 8 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,8 @@ jobs:
test:
strategy:
matrix:
go-version: [1.14.x, 1.15.x]
go-version: [1.14.x]
platform: [ubuntu-latest, windows-latest]
exclude:
# This environment is used in test-coverage.
- platform: ubuntu-latest
go-version: 1.15.x
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
Expand Down Expand Up @@ -101,7 +97,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x
go-version: ${{ matrix.go-version }}
- name: Run tests with code coverage
run: |
go version
Expand All @@ -125,13 +121,15 @@ jobs:
grep -h -v "^mode:" *.coverage >> coverage.txt
rm -f *.coverage
- name: Upload coverage to Codecov
run: bash <(curl --fail -s https://codecov.io/bash)
run: |
platform="${{ matrix.platform }}"
bash <(curl --fail -s https://codecov.io/bash) -F "${platform%%-*}"
- name: Generate coverage HTML report
run: go tool cover -html=coverage.txt -o coverage.html
- name: Upload coverage report
uses: actions/upload-artifact@v2
with:
name: test-coverage-report
name: test-coverage-report-${{ matrix.platform }}
path: coverage.html

configure:
Expand Down

0 comments on commit 0b8ecaf

Please sign in to comment.