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 rust build with turbo #261

Conversation

PatrykWalach
Copy link
Collaborator

Closes #19

@PatrykWalach
Copy link
Collaborator Author

These are in parallel so I've added artifact-name to cache key so there's no race conditions

Copy link
Collaborator

@rbalicki2 rbalicki2 left a comment

Choose a reason for hiding this comment

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

can you please rebase this on main and I'll review it again?

path: .turbo
key: ${{ runner.os }}-turbo-${{ inputs.artifact-name }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-${{ inputs.artifact-name }}-
Copy link
Collaborator

Choose a reason for hiding this comment

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

TBH I don't really understand what's happening here, so apologies for the basic question, but should we have ${{ inputs.artifact-name }}-${{ github.sha }} or the like here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This restores .turbo directory that contains all the hashed inputs and outputs.

The actions/cache will lookup key first, then if it's not available it will look for entry starting with the patterns provided in restore-keys.
So this let's us restore cache from previous commit.

turbo.json Outdated
"$schema": "https://turbo.build/schema.json",
"tasks": {
"//#build": {
"inputs": ["crates/**", "Cargo.*"],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps we should add relay-crates/** as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good catch

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.

Re-use cached artifacts from other builds
2 participants