|
19 | 19 | - .gitlab/ci/build_rs_core.yml |
20 | 20 | variables: |
21 | 21 | RUST_CORE_PATH: packages/rs-core |
| 22 | + before_script: |
| 23 | + # Enable the compile cache only when the image provides sccache, so |
| 24 | + # pipelines still on an older rust image keep working. |
| 25 | + - command -v sccache >/dev/null && export RUSTC_WRAPPER=sccache || true |
| 26 | + # Self-populating per job: the first run downloads and compiles |
| 27 | + # everything and uploads the result; every run after starts with warm |
| 28 | + # crate sources and sccache hits for unchanged crates. |
22 | 29 | cache: |
23 | | - - key: rs-core-cargo-deps-${CI_COMMIT_REF_SLUG} |
24 | | - fallback_keys: |
25 | | - - rs-core-cargo-deps-${CI_DEFAULT_BRANCH} |
26 | | - paths: |
27 | | - - .cargo/registry/index |
28 | | - - .cargo/registry/cache |
29 | | - - .cargo/git/db |
30 | | - - key: rs-core-target-${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG} |
31 | | - fallback_keys: |
32 | | - - rs-core-target-${CI_JOB_NAME}-${CI_DEFAULT_BRANCH} |
33 | | - paths: |
34 | | - - target |
| 30 | + key: |
| 31 | + files: |
| 32 | + - Cargo.lock |
| 33 | + prefix: cargo-${CI_JOB_NAME} |
| 34 | + paths: |
| 35 | + - .cargo/registry/index |
| 36 | + - .cargo/registry/cache |
| 37 | + - .cargo/git/db |
| 38 | + - .sccache |
| 39 | + policy: pull-push |
35 | 40 |
|
36 | 41 | .rust-check: |
37 | 42 | extends: .rs-core-workflow |
@@ -90,6 +95,20 @@ rs-core-uniffi-web-build: |
90 | 95 | - !reference [.rn-sdk-workflow, rules] |
91 | 96 | - !reference [.app-workflow, rules] |
92 | 97 | - !reference [.release-workflow, rules] |
| 98 | + # Self-populating per job: the first run downloads and compiles |
| 99 | + # everything and uploads the result; every run after starts with warm |
| 100 | + # crate sources and sccache hits for unchanged crates. |
| 101 | + cache: |
| 102 | + key: |
| 103 | + files: |
| 104 | + - Cargo.lock |
| 105 | + prefix: cargo-${CI_JOB_NAME} |
| 106 | + paths: |
| 107 | + - .cargo/registry/index |
| 108 | + - .cargo/registry/cache |
| 109 | + - .cargo/git/db |
| 110 | + - .sccache |
| 111 | + policy: pull-push |
93 | 112 | script: |
94 | 113 | - cd packages/rs-core-uniffi-web |
95 | 114 | - | |
|
0 commit comments