do a build with default features before all the customised builds, should help speed things up more
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
Lynne Megido 2021-05-07 02:49:17 +10:00
parent 0b1abcd659
commit 394bcf1897
Signed by: lynnesbian
GPG Key ID: F0A184B5213D9F90

View File

@ -16,20 +16,22 @@ default:
stages: stages:
- lint - lint
- cache-cleanup - cache-cleanup
- build-base
- build - build
- version - version
- test - test
# TEMPLATE # TEMPLATES
.cargo-build:
stage: build .cargo-cleanup:
parallel: stage: cache-cleanup
matrix: allow_failure: true
- FEATURES: script:
- xdg-mime-backend - cargo install cargo-sweep
- infer-backend - cargo sweep -i
- multi-threaded xdg-mime-backend
- multi-threaded infer-backend .cargo-build-base:
stage: build-base
only: only:
refs: refs:
@ -40,14 +42,21 @@ stages:
- .gitlab-ci.yml - .gitlab-ci.yml
script: script:
cargo build --no-default-features --locked --features="json $FEATURES" cargo build --locked
.cargo-build:
extends: .cargo-build-base
stage: build
parallel:
matrix:
- FEATURES:
- xdg-mime-backend
- infer-backend
- multi-threaded xdg-mime-backend
- multi-threaded infer-backend
.cargo-cleanup:
stage: cache-cleanup
allow_failure: true
script: script:
- cargo install cargo-sweep cargo build --no-default-features --locked --features="json $FEATURES"
- cargo sweep -i
.cargo-test: .cargo-test:
extends: .cargo-build extends: .cargo-build
@ -86,15 +95,40 @@ cleanup-nightly:
- target - target
- .cargo - .cargo
# BUILD BASE
build-base-stable:
extends: .cargo-build-base
needs: ["cleanup-stable"]
build-base-msrv:
extends: build-base-stable
needs: ["cleanup-msrv"]
image: "rust:1.43.0"
cache:
key: msrv
paths:
- target
- .cargo
build-base-nightly:
extends: build-base-stable
needs: ["cleanup-nightly"]
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"] needs: ["build-base-stable"]
build-msrv: build-msrv:
extends: build-stable extends: build-stable
needs: ["cleanup-msrv"] needs: ["build-base-msrv"]
image: "rust:1.43.0" image: "rust:1.43.0"
cache: cache:
key: msrv key: msrv
@ -104,7 +138,7 @@ build-msrv:
build-nightly: build-nightly:
extends: build-stable extends: build-stable
needs: ["cleanup-nightly"] needs: ["build-base-nightly"]
image: "rustlang/rust:nightly" image: "rustlang/rust:nightly"
cache: cache:
key: nightly key: nightly