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: stages:
- lint - lint
- cache-cleanup
- build - build
- version - version
- test - test
@ -41,12 +42,22 @@ stages:
script: script:
cargo build --no-default-features --locked --features="json $FEATURES" 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: .cargo-test:
extends: .cargo-build extends: .cargo-build
stage: test stage: test
script: script:
cargo test --no-default-features --locked --verbose --features="json $FEATURES" cargo test --no-default-features --locked --verbose --features="json $FEATURES"
# LINT
clippy: clippy:
stage: lint stage: lint
script: script:
@ -54,13 +65,37 @@ clippy:
- cargo clippy --version - cargo clippy --version
- ./clippy.sh ci - ./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
build-stable: build-stable:
extends: .cargo-build extends: .cargo-build
needs: ["cleanup-stable"]
build-msrv: build-msrv:
extends: build-stable extends: build-stable
needs: ["cleanup-msrv"]
image: "rust:1.43.0" image: "rust:1.43.0"
cache: cache:
key: msrv key: msrv
@ -70,6 +105,7 @@ build-msrv:
build-nightly: build-nightly:
extends: build-stable extends: build-stable
needs: ["cleanup-nightly"]
image: "rustlang/rust:nightly" image: "rustlang/rust:nightly"
cache: cache:
key: nightly key: nightly