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

Not working tool-cache #58

Closed
8398a7 opened this issue Aug 15, 2019 · 5 comments · Fixed by amazing-print/amazing_print#61
Closed

Not working tool-cache #58

8398a7 opened this issue Aug 15, 2019 · 5 comments · Fixed by amazing-print/amazing_print#61

Comments

@8398a7
Copy link
Contributor

8398a7 commented Aug 15, 2019

I used tookit-cache and realized that it was not cached.
Since it is still beta, I would like to know if it will be added in the future or if it is an unknown bug.

I confirmed the same phenomenon in the actions I created, but also in setup-go / setup-node.
The confirmation method is debug log output.
I noticed that the following log was output.

Run actions/setup-node@v1
##[debug]isExplicit: 10.15.0
##[debug]explicit? true
##[debug]checking cache: /opt/hostedtoolcache/node/10.15.0/x64
##[debug]not found
##[debug]Downloading https://nodejs.org/dist/v10.15.0/node-v10.15.0-linux-x64.tar.gz
##[debug]Downloading /home/runner/work/_temp/1d4e5ef4-2f92-4197-9c9f-01b08ce03cef
##[debug]download complete
in/tar xzC /home/runner/work/_temp/c3f24f59-12e4-4e3f-9b9f-57add9676655 -f /home/runner/work/_temp/1d4e5ef4-2f92-4197-9c9f-01b08ce03cef
##[debug]Caching tool node 10.15.0 x64
##[debug]source dir: /home/runner/work/_temp/c3f24f59-12e4-4e3f-9b9f-57add9676655/node-v10.15.0-linux-x64
##[debug]destination /opt/hostedtoolcache/node/10.15.0/x64
##[debug]finished caching tool
Run actions/setup-go@v1
 ##[debug]isExplicit: 1.12.8
##[debug]explicit? true
##[debug]checking cache: /opt/hostedtoolcache/go/1.12.8/x64
##[debug]not found
##[debug]Downloading https://storage.googleapis.com/golang/go1.12.8.linux-amd64.tar.gz
##[debug]Downloading /home/runner/work/_temp/a9ac2dba-8748-44aa-bca0-70e83d9f6064
##[debug]download complete
in/tar xzC /home/runner/work/_temp/f35109b9-3cc5-4da3-ae90-dfd8915a6f45 -f /home/runner/work/_temp/a9ac2dba-8748-44aa-bca0-70e83d9f6064
##[debug]Caching tool go 1.12.8 x64
##[debug]source dir: /home/runner/work/_temp/f35109b9-3cc5-4da3-ae90-dfd8915a6f45/go
##[debug]destination /opt/hostedtoolcache/go/1.12.8/x64
##[debug]finished caching tool

I tried to execute either of them several times, but it was judged not found in the tc.find (https://github.com/actions/toolkit/blob/master/packages/tool-cache/src/tool-cache.ts#L391) part and the download started.

@damccorm
Copy link
Contributor

Could you share your workflow? To be clear, was it not cached for a later step or for a different job.

We don't cache tools between jobs because jobs are run in clean environments (and possibly different machines).

@damccorm
Copy link
Contributor

Ok, so I think this is working as expected. The tool cache isn't preserved between runs for the same reasons mentioned above - since we're just grabbing a machine from a hosted cloud pool and returning it when we're done there's not a way to persist state between runs. If you tried something like:

name: poc
on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Setup node
      uses: actions/setup-node@v1
      with:
        node-version: 10.15.0
    - name: Setup node
      uses: actions/setup-node@v1
      with:
        node-version: 10.15.0

you should see that it is cached for the second run.

@8398a7
Copy link
Contributor Author

8398a7 commented Aug 15, 2019

I see.
I was expecting something similar to circleci's cashe, but it was a misunderstanding.
This has already been reported(#47).

I look forward to the cache function, thank you for the wonderful product.

@lovasoa
Copy link

lovasoa commented Oct 17, 2019

Is it common to have the same action several times as different steps in the same job ? I have never seen it before, and I found it quite surprising that the cache is not repopulated when a job is created. Is support for caching between jobs planned ? It could really help speed up builds.

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 a pull request may close this issue.

3 participants