Skip to content

Add coverage build-option and coverage-report in CI#863

Merged
sporksmith merged 4 commits intoshadow:devfrom
sporksmith:coverage
Jul 6, 2020
Merged

Add coverage build-option and coverage-report in CI#863
sporksmith merged 4 commits intoshadow:devfrom
sporksmith:coverage

Conversation

@sporksmith
Copy link
Copy Markdown
Contributor

No description provided.

@sporksmith sporksmith force-pushed the coverage branch 4 times, most recently from d4f9853 to b2e0d10 Compare June 30, 2020 23:44
@sporksmith sporksmith marked this pull request as ready for review July 1, 2020 16:36
@sporksmith sporksmith changed the title Coverage Add coverage build-option and coverage-report in CI Jul 1, 2020
@sporksmith
Copy link
Copy Markdown
Contributor Author

@robgjansen @stevenengler I'll give both of you a chance to take a look, but if you'd like to opt out of reviewing in favor of the other, feel free to remove yourself as a reviewer :)

Copy link
Copy Markdown
Contributor

@stevenengler stevenengler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Copy link
Copy Markdown
Member

@robgjansen robgjansen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a note about the obscure gotcha that you mentioned in slack.

Comment on lines +59 to +62
if [ "${{ matrix.cc }}" = "gcc" ]; then COMPILERS="gcc g++"
elif [ "${{ matrix.cc}}" = "clang" ]; then COMPILERS="clang"
else exit 1
fi
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we accomplish this through a matrix.compilers variable with a sensible default (g++) that can then be overridden in each container spec where the name changed (to gcc-c++) rather than including this longer if statement as an override? That would cut down the length of the code required to override from 4 lines to 1 line, I think.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a bit a bit awkward to handle in the matrix, and in general it'd be nice not to clutter the matrix dimensions with purely "derived" dimensions.

Ended up finding another way to dedupe this logic, though: basically created a dedicated step for figuring out these parameters and re-exporting them for subsequent steps.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a bit a bit awkward to handle in the matrix, and in general it'd be nice not to clutter the matrix dimensions with purely "derived" dimensions.

Actually I just noticed the latter point is moot; the GH UI doesn't include dimensions that are only set via the 'include' stanza, such as package_manager.

I'll take one more quick look to see if I can just fold these in there; when I tried it before GH ended up creating points in the matrix instead of supplementing the existing ones, but maybe I made a mistake...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think what's happening is that the GH CI will only use the first matching item in the 'include' list, so we can't easily use it to set multiple, orthogonal, derived dimensions. (e.g. package_manager based on container, and cxx based on cc).

It might be nice to move package_manager out of there for that reason, and either set an environment variable or have the dependency-install steps be conditional on the container directly. I'm going to leave that for a different PR, though.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah the includes feature isn't well documented. My understanding is that if only one item doesn't match, it will add that item to the existing matrix element, but if there are >1 items that don't match, it will create a new matrix element with those items.

# for how these 'echo' commands work.
case "${{ matrix.cc }}" in
"gcc")
echo '::set-env name=CC:gcc'
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @stevenengler - I got the idea to use workflow commands (which I previously didn't know about) from how you added rust to the path, below. These seem to be having no effect, though. Any idea what might be going wrong?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks okay to me, but maybe try with for example CC::gcc instead of CC:gcc. If that doesn't work, maybe you can only have one command per shell? Hopefully not, but other than that I don't have any ideas.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC::gcc instead of CC:gcc

🤦 - that was it. Thanks for spotting it! :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, glad it was a simple change :)

@sporksmith
Copy link
Copy Markdown
Contributor Author

Consider adding a note about the obscure gotcha that you mentioned in slack.

Done; added a check in CMakeLists.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants