use cargo-sweep to clean up the cache every now and then
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Lynne Megido 2021-05-07 02:25:44 +10:00
parent 64efb0de27
commit a1b16bd8e0
Signed by: lynnesbian
GPG Key ID: F0A184B5213D9F90

View File

@ -15,6 +15,7 @@ default:
stages:
- lint
- cache-cleanup
- build
- version
- test
@ -41,12 +42,22 @@ stages:
script:
cargo build --no-default-features --locked --features="json $FEATURES"
.cargo-cleanup:
extends: .cargo-build
stage: cache-cleanup
allow_failure: true
script:
- cargo install cargo-sweep
- cargo sweep -i
.cargo-test:
extends: .cargo-build
stage: test
script:
cargo test --no-default-features --locked --verbose --features="json $FEATURES"
# LINT
clippy:
stage: lint
script:
@ -54,13 +65,37 @@ clippy:
- cargo clippy --version
- ./clippy.sh ci
# CACHE CLEANUP
cleanup-stable:
extends: .cargo-cleanup
cleanup-msrv:
extends: cleanup-stable
image: "rust:1.43.0"
cache:
key: msrv
paths:
- target
- .cargo
cleanup-nightly:
extends: cleanup-stable
image: "rustlang/rust:nightly"
cache:
key: nightly
paths:
- target
- .cargo
# BUILD
build-stable:
extends: .cargo-build
needs: ["cleanup-stable"]
build-msrv:
extends: build-stable
needs: ["cleanup-msrv"]
image: "rust:1.43.0"
cache:
key: msrv
@ -70,6 +105,7 @@ build-msrv:
build-nightly:
extends: build-stable
needs: ["cleanup-nightly"]
image: "rustlang/rust:nightly"
cache:
key: nightly