Dockerize CI to pin compiler dependencies and fix coverage pipeline#61
Open
MitchellThompkins wants to merge 1 commit into
Open
Dockerize CI to pin compiler dependencies and fix coverage pipeline#61MitchellThompkins wants to merge 1 commit into
MitchellThompkins wants to merge 1 commit into
Conversation
being that they are always locked-down so they don't rot. Also adds weekly pipelines to run and adds a workflow for running tests in the container locally. Modify workflow for maintaining docker image modify coverage workflow and dockerfile to support that publish new docker image attempt to derive coverage from specified gcov version manually assign CC? missing curl update container with curl I think codecov v5 requires repo secrects support c++23 while I am at it update container to support c++23 tests do what logs say test more macos versions this file does not buy us anything this should fail CI correctly now Revert "this should fail CI correctly now" This reverts commit 00cbd4c.
Author
|
Sample passing pipeline can be seen over in https://github.com/MitchellThompkins/gcem/actions/runs/24372173757. |
| name: ${{ matrix.config.name }} | ||
| runs-on: ${{ matrix.config.os }} | ||
| runs-on: ubuntu-latest | ||
| container: ghcr.io/mitchellthompkins/gcem/ci:eb24b0547d0f |
| : "${GHRCIO_TOKEN:?GHRCIO_TOKEN is not set}" | ||
|
|
||
| REGISTRY="ghcr.io" | ||
| REPO="mitchellthompkins/gcem" |
| docker build -t "${IMAGE}:${TAG}" . | ||
|
|
||
| echo "Logging in to ${REGISTRY} ..." | ||
| echo "${GHRCIO_TOKEN}" | docker login "${REGISTRY}" -u MitchellThompkins --password-stdin |
Author
There was a problem hiding this comment.
@kthohr mitchellthompkins -> kthohr (or whatever your username is)
This was referenced Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR Dockerizes all test dependencies in an effort to make the pipeline more robust and run at regular intervals (if only because I have a pathological need to see green pipelines). It maintains support for older compiler versions and fixes the code coverage pipelines. It also adds more
macosclang support for fun. As part of this dockerization it publishes its own test container to pin down dependencies; though this does require a manual step in order to maintain said container.The original cov_check script called gcov directly on each
.cppfile to locate and process its associated .gcda data, which is the low-level way to generate coverage data. lcov with--gcov-tool gcov-12and--capturedoes the equivalent by automatically scanning for .gcda and acts as a wrapper around gcov. It does the same thing but produces a standardized output format (coverage.info) that Codecov.io expects. I switched because the current pipeline was failing and the Codecov uploader needed a standard format file anyway. lcov solved both problems at once.With #58 @marcizhu implemented some similar non-Docker based solutions and does a good job (I stole their lcov idea but still invoke gcov under the hood just to maintain consistency), but I'm partial to my solution here because it preserves testing support for older compilers and c++ versions and makes the CI environment more controlled and less dependent on upstream changes.
As supporting work I added some silly script to use the same CI environment locally and some supporting documentation for all of the above in
CONTRIBUTING.md.Notably I didn't update the minimum
CMakeversion b/c that seems like an orthogonal change to me. I prefer the solution by @BartolomeyKant in #54 to #58 because I think the floor for a Cmake minimum for a header-only library is actually very low and I like keeping compatibility boundaries wide (mostly b/c I work on outdated embedded system platforms); but that's just my opinion.Project Owner TODOs
@kthor If you choose to consume this PR you'll need to do the following to make this work:
write:packagesscope to authenticate the push to ghcr.io.GitHub -> Profile -> Packages -> gcem/ci -> Package settings -> Change visibility -> Public, so CI runners can pull without authentication.CODECOV_TOKEN, and add it as a GitHub Actions secret (Settings -> Secrets -> Actions).publish-ci-image.sh. The docker login line hardcodesMitchellThompkinsas the username. You would need to change it to your own GitHub username.publish-ci-image.sh. The image is currently atghcr.io/mitchellthompkins/gcem/ciand should move toghcr.io/kthohr/gcem/ciThe script also updates the reference in main.yml automatically.Changes
apt-getonubuntu-latest, which was actively broken:clang-11andclang-12were no longer available on Ubuntu 24.04.tests/Makefileslightly to support this updated workflow.CONTRIBUTING.mdto capture some of how to test and update the container.Note: These pipelines actually pass on test failures today, and will until #59 is resolved. 2ff0096 has the required changed for that.