Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
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
Next Next commit
Avoid workflow conditional reliance on specific runner
In order to catch platform-specific bugs, the "Test Go" workflow uses a job matrix to run the tests on multiple runners.
The step that uploads code coverage data to Codecov is intended to run only during the Linux job. The runner name
`ubuntu-latest` was used in the conditional to accomplish this. However, it might become necessary or desirable to pin a
specific runner version (e.g., `ubuntu-18.04`). The accompanying adjustment to the conditional might be forgotten and
there would not be any obvious sign that the coverage upload had stopped, nor why.

This will be avoided by using the general `runner.os` context item to identify the Linux job in the conditional. This
will not be ideal in the event multiple Linux runners are added to the workflow's job matrix, but this is less likely to
occur and a redundant coverage data upload shouldn't cause any problems.
  • Loading branch information
per1234 committed Aug 25, 2021
commit bed7e0461072a49640719301bd68466ee711e8bd
2 changes: 1 addition & 1 deletion .github/workflows/test-go-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
run: task go:test

- name: Send unit tests coverage to Codecov
if: matrix.operating-system == 'ubuntu-latest'
if: runner.os == 'Linux'
uses: codecov/codecov-action@v2
with:
file: ./coverage_unit.txt
Expand Down