@@ -120,10 +120,14 @@ jobs:
120120 go-version : ' stable'
121121 cache : false
122122 - name : Cache [rust]
123+ id : rust-cache
123124 uses : Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # 2.8.1
124125 with :
125126 cache-targets : true # cache build artifacts
126127 cache-bin : true # cache the ~/.cargo/bin directory
128+ shared-key : all-features
129+ save-if : ${{ github.ref == 'refs/heads/main' }}
130+ - run : echo "rust-cache ${{ steps.rust-cache.outputs.cache-hit == 'true' && 'HIT' || 'MISS' }}"
127131 - name : " Remove nextest CI report"
128132 shell : bash
129133 run : rm -rf target/nextest/ci/junit.xml
@@ -310,10 +314,14 @@ jobs:
310314 with :
311315 submodules : recursive
312316 - name : Cache [rust]
317+ id : rust-cache
313318 uses : Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # 2.8.1
314319 with :
315320 cache-targets : true # cache build artifacts
316321 cache-bin : true # cache the ~/.cargo/bin directory
322+ shared-key : centos7
323+ save-if : ${{ github.ref == 'refs/heads/main' }}
324+ - run : echo "rust-cache ${{ steps.rust-cache.outputs.cache-hit == 'true' && 'HIT' || 'MISS' }}"
317325 - name : Build CentOS 7 Docker image
318326 run : docker build -t libdatadog-centos7 -f tools/docker/Dockerfile.centos .
319327 - name : " cargo nextest run (centos7)"
@@ -402,10 +410,14 @@ jobs:
402410 with :
403411 submodules : recursive
404412 - name : Cache [rust]
413+ id : rust-cache
405414 uses : Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # 2.8.1
406415 with :
407416 cache-targets : true
408417 cache-bin : true
418+ shared-key : default
419+ save-if : ${{ github.ref == 'refs/heads/main' }}
420+ - run : echo "rust-cache ${{ steps.rust-cache.outputs.cache-hit == 'true' && 'HIT' || 'MISS' }}"
409421 - name : Set up Docker Buildx
410422 uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # 3.10.0
411423 - name : Pre-fetch dependencies (requires network/certs on the runner)
@@ -451,10 +463,14 @@ jobs:
451463 - name : Install wasm32 target
452464 run : rustup target add wasm32-unknown-unknown
453465 - name : Cache [rust]
466+ id : rust-cache
454467 uses : Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # 2.8.1
455468 with :
456469 cache-targets : true
457470 cache-bin : true
471+ shared-key : wasm
472+ save-if : ${{ github.ref == 'refs/heads/main' }}
473+ - run : echo "rust-cache ${{ steps.rust-cache.outputs.cache-hit == 'true' && 'HIT' || 'MISS' }}"
458474 - name : Install wasm-bindgen test runner
459475 run : cargo install wasm-bindgen-cli --version 0.2.100 --locked
460476 - name : " cargo check -p libdd-data-pipeline --target wasm32-unknown-unknown --no-default-features"
0 commit comments