-
Notifications
You must be signed in to change notification settings - Fork 314
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(github): Run Docker as the GitHub user to simplify code #8536
Conversation
70c02e9
to
69fa546
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8536 +/- ##
=========================================
Coverage 67.68% 67.68%
Complexity 1006 1006
=========================================
Files 246 246
Lines 7924 7924
Branches 883 883
=========================================
Hits 5363 5363
Misses 2181 2181
Partials 380 380
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
19acfef
to
58522f7
Compare
Group workspace-related `docker run` arguments for a better overview. Signed-off-by: Sebastian Schuberth <[email protected]>
The `all-tools` target indirectly inherits from the `base` image which has `ENTRYPOINT [ "/bin/bash" ]`. Signed-off-by: Sebastian Schuberth <[email protected]>
Simplify the command string by setting the environment variable via the dedicated `-e` option for Docker. Signed-off-by: Sebastian Schuberth <[email protected]>
58522f7
to
84e31cd
Compare
The `all-tools` target of the Docker image contains a `/home/ort` directory that belongs to the Docker image's "ort" user (UID 1000), but it does not contain a `/home/ort/.gradle` directory yet. Ideally, one would like to simply mount `/home/runner/.gradle:/home/ort/.gradle` without any `chown` magic, but that does not work as the Docker image's user does not exist on the host and thus the directory is not accessible. Also just running the Docker image as the host user does not work, as the mount point's parent directory (`/home/ort`) belongs to the Docker image's "ort" user, so Gradle cannot create any sub-directories below `.gradle` as the host user. As a solution, simply mount to a non-existing home directory in the Docker image, and just choose that to be the same directory as on the host (`/home/runner`). As now `HOME` needs to be set, let Gradle deduce `GRADLE_USER_HOME` from it automatically. Signed-off-by: Sebastian Schuberth <[email protected]>
84e31cd
to
5888ba5
Compare
Did you already verify on a fork that the Gradle caching works? In this functional test job it doesn't (it starts with downloading Gradle) but that's expected as the GitHub actions cache is only populated from the main branch and I guess the changes invalidate the old cache. |
No, I didn't explicitly test that. How would I do that, create a PR to my branch from a fork? Or can we merge first to |
I tested everything within my fork, e.g. making a PR to the main branch within the fork. This was especially useful to test that the published Docker images were correct without messing with those in the main repository. However, we can also merge as is and if caching doesn't work either fix or revert it. |
No description provided.