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

Cache wasn't restored successfully #2

Open
kenorb opened this issue Sep 15, 2022 · 2 comments
Open

Cache wasn't restored successfully #2

kenorb opened this issue Sep 15, 2022 · 2 comments

Comments

@kenorb
Copy link

kenorb commented Sep 15, 2022

I don't think caching works properly.

First run worked fine:

Run johelegp/gcc-snapshot@v1
/usr/bin/tar --posix --use-compress-program zstd -T0 -cf cache.tzst -P -C /home/runner/work/Foo/Bar --files-from manifest.txt
Cache Size: ~0 MB (22 B)
Cache saved successfully
...
Run g++ --version
g++ (GCC) 13.0.0 20220911 (experimental)

Second run, restored cache, but g++ is the same as it was before:

Run johelegp/gcc-snapshot@v1
Received 22 of 22 (100.0%), 0.0 MBs/sec
Cache Size: ~0 MB (22 B)
/usr/bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/eb5035af-977b-.../cache.tzst -P -C /home/runner/work/Foo/Bar
Cache restored successfully
...
Run g++ --version
g++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
@JohelEGP
Copy link
Owner

Thank you for reporting this.

It seems that caching always succeeds with 22 bytes. Perhaps something changed with the condition of restorage, since this used to work.

return [ (await cache.restoreCache(paths, key, Array()) !== undefined), key ];

gcc-snapshot/index.js

Lines 41 to 42 in c7b5c01

const [ restored, key ] = await restoreCache();
if (!restored)

I actually wanted this to be a composite action rather than a JavaScript action. Now that the limitations of composite actions have been lifted, perhaps I can restore the original composite action.

@masx200
Copy link

masx200 commented May 17, 2023

 - uses: actions/cache@v3
        id: cache-gcc-13
        with:
          path: |
            /opt/gcc-latest/

          key: ${{ runner.os }}-gcc-13
      - name: install-gcc-13
        if: steps.cache-gcc-13.outputs.cache-hit != 'true'
        run: |
          wget http://kayari.org/gcc-latest/gcc-latest.deb && sudo dpkg -i gcc-latest.deb && rm gcc-latest.deb

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

No branches or pull requests

3 participants