-
Notifications
You must be signed in to change notification settings - Fork 0
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
ci: use caching from docker to run test in CI #169
Conversation
72cbde9
to
172be2d
Compare
As we can see here this works rather okay out of the box, but I have tried it several times now and somehow it always executes the build stage even if the source code didn't change. I'm not sure what is invalidating the cache for that stage |
e118d1e
to
2554f0e
Compare
This seems to work now, thanks @LouisBrunner |
Dockerfile
Outdated
|
||
FROM base as code | ||
WORKDIR /src | ||
COPY --from=apt-dependencies /tmp/apt / | ||
COPY --from=dependencies /tmp/deps /usr | ||
COPY . /src | ||
COPY licenses licenses |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.dockerignore is better for ignoring specific folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I put stuff into dockerignore, I can't copy them anymore. I just want to be selective with copying to not invalidate caches unintentionally. If you copy .
then docker will continue at this line, even though you maybe only changed something in python, so the cpp build is not necessary
6ae1031
to
97f289c
Compare
Okay I'm now finally kind of happy with this PR. Instead of having 3 different test actions (source, proto, python) where you'ds see immediately which tests have failed, everything is now tested in the same step and will just fail somewhere during the build action. However, this allows for best caching. To see that, I invite you to check the last 3 successful workflow runs:
Leaving those two last commits here for you to see the workflows, then I'll have to remove it again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the additional example commits to see the caching. The actions and workflow are definitely much simpler now.
N.B. after this we will have to update the branch protection rules which currently expect and require the existing actions to run
I'm not sure, I can't see them under the branch settings. I had the same thoughts as you though |
Description
Let's start small, first would be to run the tests with the caching action from docker and github.
Review guidelines
Estimated Time of Review: 5 minutes
Checklist before merging: