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

Speedup workflow selfbuild and test using sccache #206

Closed
wants to merge 16 commits into from

Conversation

NobodyXu
Copy link
Member

@NobodyXu NobodyXu commented Mar 17, 2023

  • Use sccache to speedup workflow selfbuild and test.
  • Add workflow cache-cleanup.yml to remove unused cache, since GHA does not allow
    main branch to use caches created by another branch.

TODO

  • Set CARGO_BUILD_TARGET_DIR on workflow using sccache for better cache reuse. (cargo-install would automatically mkdir -p "${CARGO_BUILD_TARGET_DIR})
  • Update cache-cleanup.yml from cargo-binstall
  • Use sparse index: CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
    If this is not good enough, then also cache index:
     - name: Configure index cache
       uses: actions/cache@v3
       with:
          path: |
           ~/.cargo/registry/index/
           ~/.cargo/registry/cache/
           ~/.cargo/git/db/
         key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}-${{ inputs.cache-suffix }}
         restore-keys: |
           ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}-
           ${{ runner.os }}-cargo-index-
  • Replace sccache-action with taiki-e/install-action
    and then setup environments required manually:
     - name: Configure sccache
       uses: actions/github-script@v6
       with:
         script: |
           core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
           core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

Signed-off-by: Jiahao XU Jiahao_XU@outlook.com

@NobodyXu NobodyXu changed the title Speedup selfbuild Speedup job build-needing-cc of workflow selfbuild Mar 17, 2023
@NobodyXu NobodyXu changed the title Speedup job build-needing-cc of workflow selfbuild Speedup workflow selfbuild and test using sccache Mar 17, 2023
@NobodyXu
Copy link
Member Author

The CI failed due to a bug in upstream rust-secure-code/cargo-auditable#87

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
@NobodyXu NobodyXu force-pushed the speedup-selfbuild branch 2 times, most recently from da15d1f to 0c26ced Compare June 16, 2023 14:23
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
@NobodyXu
Copy link
Member Author

Closed since according to my experience, sccache with GHA backend doesn't provide much speedup at all.

@NobodyXu NobodyXu closed this Sep 11, 2023
@NobodyXu NobodyXu deleted the speedup-selfbuild branch September 11, 2023 13:26
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

1 participant