Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Caching doesn't work (for me) #1

Open
jeroenvandijk opened this issue Feb 18, 2020 · 9 comments
Open

Caching doesn't work (for me) #1

jeroenvandijk opened this issue Feb 18, 2020 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@jeroenvandijk
Copy link

jeroenvandijk commented Feb 18, 2020

Hi Kirill,

Thank you for sharing this Github Action!

It works perfectly except for caching of the GraalVM download. It seems to add 30 unnecessary seconds for each build.

This is my configuration:

      - name: Prepare GraalVM
        uses: DeLaGuardo/[email protected]
        with:
          graalvm-version: "19.3.0.java8"

      - name: Install native-image
        run: |
          echo 
          gu install native-image

The Prepare GraalVM step takes around 30 seconds. Did I miss something in my configuration?

It seems your code tries to detect this situation here https://github.com/DeLaGuardo/setup-graalvm/blob/master/src/installer.ts#L43

@DeLaGuardo
Copy link
Owner

Thanks for spotting that out. Will try to resolve asap

@DeLaGuardo DeLaGuardo self-assigned this Feb 18, 2020
@DeLaGuardo DeLaGuardo added the bug Something isn't working label Feb 18, 2020
@DeLaGuardo
Copy link
Owner

Could you change your workflow file?

      - name: Prepare GraalVM
        uses: DeLaGuardo/[email protected]
        with:
          graalvm-version: "19.3.0.java8"

      - name: Second prepare GraalVM
        uses: DeLaGuardo/[email protected]
        with:
          graalvm-version: "19.3.0.java8"

      - name: Install native-image
        run: |
          echo 
          gu install native-image

tool-cache suppose to keep the cache until you have something to run and got wiped after finish

image

@jeroenvandijk
Copy link
Author

I'm still waiting for the new job to complete

Also I didn't mention it, but this is a run on a mac (runs-on: macOS-latest). I'll add a run for Linux to see if it works there

@jeroenvandijk
Copy link
Author

jeroenvandijk commented Feb 18, 2020

Ok the step Second prepare GraalVM in the Mac Osx takes 0 seconds. When I test this on a Linux machine I see the same behaviour.

I've been able to cache other steps (maven dependencies), but for this I had to add:

      - name: Cache deps
        uses: actions/cache@v1
        id: cache-deps
        with: 
          path: ~/.m2/repository
          key: ${{ runner.os }}-maven-${{ hashFiles('project.clj') }} # Other deps files?
          restore-keys: |
                ${{ runner.os }}-maven-
  
      - name: Fetch deps
        if: steps.cache-deps.outputs.cache-hit != 'true'
        run: |
          lein deps

I couldn't find anything like that in your code (could have looked wrong of course)

@DeLaGuardo
Copy link
Owner

That is correct. I'm doing almost the same in my company's project. The only difference - you do not need if. I will update this issue with part of my flowfile later.

@jeroenvandijk
Copy link
Author

I think you are correct that it doesn't make a big difference, lein deps with a cache is pretty quick. If you do choose to add the if, you see in the github interface that the step is actually skipped (and it saves 1 sec i guess). Not a big deal.

@DeLaGuardo
Copy link
Owner

So I guess this issue can be closed, isn't it?

@jeroenvandijk
Copy link
Author

I was talking about the maven caching, not the GraalVM download. That is still not cached. Do you mean I should add an actions/cache@v1 step for your action to be cached?

@DeLaGuardo
Copy link
Owner

I tried to add "caching between jobs" via actions/cache@1 without success, unfortunately. I'm not seeing any ways how to make this available atm, sorry. actions/toolkit#58 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants