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

make depot if not restored #91

Merged
merged 3 commits into from
Jan 16, 2024
Merged

make depot if not restored #91

merged 3 commits into from
Jan 16, 2024

Conversation

IanButterworth
Copy link
Member

This helps other following actions know that this action ran
i.e. julia-actions/julia-buildpkg#41

Alternatively we could set an env var, but this seems logical to me

# for other julia actions to check, like https://github.com/julia-actions/julia-buildpkg/pull/41
- name: make depot if not restored, then list depot directory sizes
run: |
mkdir -p ${{ steps.paths.outputs.depot }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd personally make this a separate step which only occurs on a cache miss

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it seems that steps.cache.outputs.cache-hit is only true if the full key is hit. We only ever hit partial hits by design, so will always be false, so the only way to do this would be to check if the dir exists in the cmd rather than do an if.

The current setup is robust to this, so maybe we just leave this PR as is?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct. This would be possible to determine if actions/cache had the same outputs as actions/cache/restore. Oh well

# for other julia actions to check, like https://github.com/julia-actions/julia-buildpkg/pull/41
- name: make depot if not restored, then list depot directory sizes
run: |
mkdir -p ${{ steps.paths.outputs.depot }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct. This would be possible to determine if actions/cache had the same outputs as actions/cache/restore. Oh well

@IanButterworth IanButterworth merged commit dc1a3cd into main Jan 16, 2024
17 checks passed
@IanButterworth IanButterworth deleted the ib/make_anyway branch January 16, 2024 15:48
- name: make depot if not restored, then list depot directory sizes
run: |
mkdir -p ${{ steps.paths.outputs.depot }}
du -shc ${{ steps.paths.outputs.depot }}/* || true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this should be guarded behind something, otherwise it looks a bit like an error in the logs when the folder is empty:

du: cannot access '/home/runner/.julia/*': No such file or directory

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I tried to figure that out but couldn't. It's the contents that doesn't exist not the dir.

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 this pull request may close these issues.

3 participants