bats-core / bats-action

Github action that setup Bats and all the bats libs: support, assert, detik, file.
MIT License
4 stars 7 forks source link

bats-action: generates warnings trying to untar the cache #9

Closed dekimsey closed 4 months ago

dekimsey commented 4 months ago

Describe the bug The bats-core/bats-action GitHub Action generates a number of tar extraction warnings while unpacking the cache.

Note: This is reported here because the bats-core/bats-action repository doesn't have issues enabled, I hope I haven't misunderstood!

To Reproduce Steps to reproduce the behavior:

  1. Run GHA workflow that populates the cache
  2. Run workflow again

Expected behavior Cache extraction should succeed and not generate warnings.

Environment (please complete the following information):

Additional context

Self-hosted runner.

First run:

Run actions/cache@v4
Cache not found for input keys: Linux-bats-
Run # In $HOME to avoid sudo requirements
Installed Bats to /home/runner/.local/share/bats/bin/bats
Bats v1.11.0 installed in /home/runner/.local/share/bats
Run actions/cache@v4
Cache not found for input keys: Linux-bats-support-0.3.0
Run VERSION=0.3.0
Bats Support v0.3.0 installed in /usr/lib/bats-support

Subsequent runs:

Run actions/cache@v4
Cache Size: ~0 MB (3640 B)
/usr/bin/tar -xf /home/runner/work/_temp/8b89cf35-d286-498e-9531-00378454e3da/cache.tzst -P -C /home/runner/work/expert-happiness/expert-happiness --use-compress-program unzstd
/usr/bin/tar: ../../../../../usr/lib/bats-support: Cannot mkdir: Permission denied
/usr/bin/tar: ../../../../../usr/lib/bats-support: Cannot mkdir: Permission denied
/usr/bin/tar: ../../../../../usr/lib/bats-support/load.bash: Cannot open: No such file or directory
/usr/bin/tar: ../../../../../usr/lib/bats-support: Cannot mkdir: Permission denied
/usr/bin/tar: ../../../../../usr/lib/bats-support/src: Cannot mkdir: No such file or directory
/usr/bin/tar: ../../../../../usr/lib/bats-support: Cannot mkdir: Permission denied
/usr/bin/tar: ../../../../../usr/lib/bats-support/src/output.bash: Cannot open: No such file or directory
/usr/bin/tar: ../../../../../usr/lib/bats-support: Cannot mkdir: Permission denied
/usr/bin/tar: ../../../../../usr/lib/bats-support/src/error.bash: Cannot open: No such file or directory
/usr/bin/tar: ../../../../../usr/lib/bats-support: Cannot mkdir: Permission denied
/usr/bin/tar: ../../../../../usr/lib/bats-support/src/lang.bash: Cannot open: No such file or directory
/usr/bin/tar: Exiting with failure status due to previous errors
Warning: Failed to restore: "/usr/bin/tar" failed with error: The process '/usr/bin/tar' failed with exit code 2
Cache not found for input keys: Linux-bats-support-0.3.0

Attached are more detailed logs of both.

martin-schulze-vireso commented 4 months ago

The GitHub mobile app won't let me transfer this. Please report this here: https://github.com/bats-core/bats-action

Transferred it now.

brokenpip3 commented 4 months ago

Hi @dekimsey this is a well know issue, check the readme: https://github.com/bats-core/bats-action?tab=readme-ov-file#about-caching or this issue

dekimsey commented 4 months ago

Hi @dekimsey this is a well know issue, check the readme: https://github.com/bats-core/bats-action?tab=readme-ov-file#about-caching or this issue

Ah, my apologies. I was confused when I read that section of the readme. I didn't understand the work around was needed.

Thank you for the pointer, I'll go copy/paste some lines there! Is there any reason I might want to use a custom path into my workspace instead of the automatically imported user lib path? ~/.bats/libs/

brokenpip3 commented 4 months ago

Is there any reason I might want to use a custom path into my workspace instead of the automatically imported user lib path? ~/.bats/libs/

Nope, the important part is use a path that is inside the runner user home so the cache will work :)