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

hint that checkout has to be done first #34

Merged
merged 1 commit into from Sep 28, 2021
Merged

Conversation

SergNikitin
Copy link
Contributor

Hey @Swatinem, thank you for this awesome project!

Disclaimer: I'm not very experienced either with GitHub actions or rust, so this might be an incorrect change -- feel free to ignore the PR if so.

As far as my experience with this action goes, it does not seem to do anything if the repo gets checked out after the cache setup. Placing the actions/checkout step before the rust-cache step seems to solve the problem though. So

# no caching
- uses: actions-rs/toolchain@v1
  with:
    profile: minimal
    toolchain: stable
- uses: Swatinem/rust-cache@v1
- uses: actions/checkout@v2 # checkout at the end
# caching works
- uses: actions/checkout@v2 # checkout at the top
- uses: actions-rs/toolchain@v1
  with:
    profile: minimal
    toolchain: stable
- uses: Swatinem/rust-cache@v1

It might be a common practice in github actions community to always stick actions/checkout at the top of the yaml file, but for someone less experienced like me it may seem intuitive to set up caches first, do everything else after - that's what I did, and had to pay for it with a couple of hours of debugging time.

This change adds the checkout step to the readme example explicitly so people like myself who cluelessly copy-paste examples have less things to trip over :)

@SergNikitin SergNikitin changed the title hint that checkout has to be used first hint that checkout has to be done first Sep 25, 2021
@Swatinem Swatinem merged commit 801365c into Swatinem:v1 Sep 28, 2021
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.

None yet

2 participants