jurplel / install-qt-action

Install Qt on your Github Actions workflows with just one simple action
MIT License
459 stars 78 forks source link

caching is not working #104

Closed Mostafa-wael closed 2 years ago

Mostafa-wael commented 3 years ago

I have tried the attached code in the readme file for the cache but it failed, saying that no cache is found. I managed to find a solution to the problem and I am willing to add it in a pull request.

pzhlkj6612 commented 3 years ago

Hi. Could you please briefly share what problems you found?

pzhlkj6612 commented 3 years ago

Hi. Could you please briefly share what problems you found?

I mean, please provide a minimal reproducible example about this problem, otherwise other people may not be able to get your point.

Mostafa-wael commented 3 years ago

gnome-shell-screenshot-JJSJ90 gnome-shell-screenshot-1XGA90

I know that there is no cache in the first time but, this problem arises in the third run of the GitHub actions. The problem was fixed after setting the path and the key, I mean a global fix, not specific for my code or machine.

AnotherFoxGuy commented 2 years ago

I just ran into the same issue, this seems to be the problem

firefox_2021-09-22_13-11-37

pzhlkj6612 commented 2 years ago

Hi @Mostafa-wael and @AnotherFoxGuy , I think you may need to switch to actions/cache@ v1 .

See also https://github.com/jurplel/install-qt-action/issues/51#issuecomment-778594660 .

AnotherFoxGuy commented 2 years ago

I fixed it by using the following setup:

- name: Cache Qt
  id: cache-qt
  uses: actions/cache@v2.1.6
  with:
    path: "${{ github.workspace }}/qt/"
    key: ${{ runner.os }}-QtCache

- name: Install Qt
  uses: jurplel/install-qt-action@v2
  with:
    cached: ${{ steps.cache-qt.outputs.cache-hit }}
    dir: "${{ github.workspace }}/qt/"
pzhlkj6612 commented 2 years ago

I fixed it by using the following setup:

  uses: actions/cache@v2.1.6
  with:
    path: "${{ github.workspace }}/qt/"

@AnotherFoxGuy Yes, it works because you are now using an absolute path.