Skip to content
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

docker based workflow cannot cache #2522

Open
Codelax opened this issue Apr 6, 2023 · 1 comment
Open

docker based workflow cannot cache #2522

Codelax opened this issue Apr 6, 2023 · 1 comment
Labels
bug Something isn't working keep Label can be added as soon as we are sure the work on the issue is necessary

Comments

@Codelax
Copy link

Codelax commented Apr 6, 2023

Describe the bug
For setup-* actions they cache tools in RUNNER_TOOL_CACHE.
Doing so does not seems possible in docker based actions although the env variable is available.
For example on ubuntu github hosted runner, RUNNER_TOOL_CACHE has the path of /opt/hostedtoolcache which is not mounted onto the container, thus making it impossible to add a tool to cache and add it to path.

I tried other solutions by caching it in GITHUB_WORKSPACE but paths are not translated when being written to GITHUB_PATH, also the workspace may be the repository if checkout has been it before this action.

Expected behavior
I would expect the container workflow to have environment variables leading to usable directory and potentially paths to be converted when written in GITHUB_PATH as paths in env variables does not correspond to the runner ones.

Runner Version and Platform

Current runner version: '2.303.0'
Operating System
  Ubuntu
  22.04.2
  LTS
Runner Image
  Image: ubuntu-22.04
  Version: 20230402.1
  Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20230402.1/images/linux/Ubuntu2204-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20230402.1
Runner Image Provisioner
  2.0.139.1
@Codelax Codelax added the bug Something isn't working label Apr 6, 2023
@nikola-jokic nikola-jokic added the keep Label can be added as soon as we are sure the work on the issue is necessary label Apr 21, 2023
@bnakhlis
Copy link

bnakhlis commented Aug 9, 2023

attached is the log from running below jobs on a runner using image ghcr.io/actions/actions-runner:latest

with and without setting hostedtoolcache. (iot-test with and iot is without)

ENV RUNNER_TOOL_CACHE=/opt/hostedtoolcache
RUN sudo mkdir /opt/hostedtoolcache
&& sudo chgrp docker /opt/hostedtoolcache
&& sudo chmod g+rwx /opt/hostedtoolcache

logs_70.zip
logs_70.zip

to replicate

steps:
- name: Setup Maven Action
uses: s4u/setup-maven-action@v1.8.0
with:
java-version: ${{ env.JAVA_VERSION }}
maven-version: ${{ env.MAVEN_VERSION }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working keep Label can be added as soon as we are sure the work on the issue is necessary
Projects
None yet
Development

No branches or pull requests

3 participants