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

Implement sccache and cargo registry & git sources cache in the workflows #259

Closed
3 tasks done
ggonzalez94 opened this issue Jul 24, 2024 · 1 comment · Fixed by #265
Closed
3 tasks done

Implement sccache and cargo registry & git sources cache in the workflows #259

ggonzalez94 opened this issue Jul 24, 2024 · 1 comment · Fixed by #265
Assignees
Labels
CI devops

Comments

@ggonzalez94
Copy link
Collaborator

ggonzalez94 commented Jul 24, 2024

templates

  • Generic Runtime Template
  • Evm Template

What is the feature you would like to see?

Build times are known to be long in Polkadot and our workflows already take > 1hr each.
We can improve this if we use caching(especially sccache). This is a common practice across ecosystem projects(check frontier and moonbeam for example).
This should look something like this:

 - name: Cache cargo registry & git sources
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/bin/
            ~/.cargo/registry/
            ~/.cargo/git/db/
          key: ${{ runner.os }}-cargo-unittest-${{ hashFiles('**/Cargo.lock') }}
          restore-keys: |
            ${{ runner.os }}-cargo-unittest-${{ hashFiles('**/Cargo.lock') }}
            ${{ runner.os }}-cargo-unittest-
            ${{ runner.os }}-cargo-

  - name: Run sccache
    uses: mozilla-actions/[email protected]

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines
@ggonzalez94 ggonzalez94 added the CI devops label Jul 24, 2024
@ggonzalez94 ggonzalez94 self-assigned this Jul 24, 2024
@ggonzalez94 ggonzalez94 changed the title Implement sscache and cargo registry & git sources cache in the workflows Implement sccache and cargo registry & git sources cache in the workflows Jul 24, 2024
@ggonzalez94
Copy link
Collaborator Author

Started working on this and the results look good so far. After adding it to the generic template the time for the workflow went from 55min on the first run to 31min the second time

@ggonzalez94 ggonzalez94 moved this from Backlog to In Development in Substrate Runtime Templates Jul 25, 2024
@ggonzalez94 ggonzalez94 moved this from In Development to In Review in Substrate Runtime Templates Jul 30, 2024
@github-project-automation github-project-automation bot moved this from In Review to Done in Substrate Runtime Templates Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI devops
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant