Skip to content

Avoid workflow conditional reliance on specific runner #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 18, 2021
Merged

Avoid workflow conditional reliance on specific runner #142

merged 1 commit into from
Aug 18, 2021

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Aug 15, 2021

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, I'm observing that sometimes it is 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, not why.

So I'm thinking the better approach would be to use 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 I haven't observed that in practice, and anyway a double upload shouldn't cause any problems.

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Aug 15, 2021
@per1234 per1234 requested a review from umbynos August 15, 2021 12:12
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, I'm observing that sometimes it is 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.

So I'm thinking the better approach would be to use 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 I
haven't observed that in practice and the double upload shouldn't cause any problems.
@per1234 per1234 merged commit ea4e7df into arduino:main Aug 18, 2021
@per1234 per1234 deleted the linux-conditional branch August 18, 2021 08:57
@per1234 per1234 self-assigned this Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants