From e78a4368ae8ccf226e8d440e96339621e508fdf3 Mon Sep 17 00:00:00 2001 From: Ritesh Chitlangi Date: Fri, 12 Nov 2021 00:55:59 +0800 Subject: [PATCH] cache output files per branch for parallel builds --- .drone.yml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/.drone.yml b/.drone.yml index 156f8af..53898ef 100644 --- a/.drone.yml +++ b/.drone.yml @@ -19,8 +19,9 @@ steps: - name: config path: /root/.config/epp-client commands: - - export CARGO_HOME=/tmp/cargo - - export CARGO_TARGET_DIR=/tmp/cargo-target + - export CARGO_HOME=/tmp/cargo/$DRONE_BRANCH + - export CARGO_TARGET_DIR=/tmp/cargo-target/$DRONE_BRANCH + - mkdir -p $CARGO_HOME $CARGO_TARGET_DIR - cargo check --all-targets - name: fmt @@ -35,8 +36,9 @@ steps: - name: config path: /root/.config/epp-client commands: - - export CARGO_HOME=/tmp/cargo - - export CARGO_TARGET_DIR=/tmp/cargo-target + - export CARGO_HOME=/tmp/cargo/$DRONE_BRANCH + - export CARGO_TARGET_DIR=/tmp/cargo-target/$DRONE_BRANCH + - mkdir -p $CARGO_HOME $CARGO_TARGET_DIR - cargo fmt --all -- --check - name: clippy @@ -51,8 +53,9 @@ steps: - name: config path: /root/.config/epp-client commands: - - export CARGO_HOME=/tmp/cargo - - export CARGO_TARGET_DIR=/tmp/cargo-target + - export CARGO_HOME=/tmp/cargo/$DRONE_BRANCH + - export CARGO_TARGET_DIR=/tmp/cargo-target/$DRONE_BRANCH + - mkdir -p $CARGO_HOME $CARGO_TARGET_DIR - cargo clippy --workspace --all-targets -- -D warnings - name: test @@ -67,8 +70,9 @@ steps: - name: config path: /root/.config/epp-client commands: - - export CARGO_HOME=/tmp/cargo - - export CARGO_TARGET_DIR=/tmp/cargo-target + - export CARGO_HOME=/tmp/cargo/$DRONE_BRANCH + - export CARGO_TARGET_DIR=/tmp/cargo-target/$DRONE_BRANCH + - mkdir -p $CARGO_HOME $CARGO_TARGET_DIR - cargo test -- --nocapture - name: crates.io @@ -85,8 +89,9 @@ steps: - name: crates path: /root/.cargo commands: - - export CARGO_HOME=/tmp/cargo - - export CARGO_TARGET_DIR=/tmp/cargo-target + - export CARGO_HOME=/tmp/cargo/$DRONE_BRANCH + - export CARGO_TARGET_DIR=/tmp/cargo-target/$DRONE_BRANCH + - mkdir -p $CARGO_HOME $CARGO_TARGET_DIR - export EPP_CLIENT_VERSION_CHANGE=$(git diff HEAD^ HEAD -- epp-client/Cargo.toml | grep -E "([+\-]){1}version" | wc -l) - if [ $EPP_CLIENT_VERSION_CHANGE -eq 2 ]; then echo "epp-client version updated. publishing to crates.io" && cd epp-client && cargo publish && cd .. ; else echo "epp-client version unchanged"; fi - export EPP_CLIENT_MACROS_VERSION_CHANGE=$(git diff HEAD^ HEAD -- epp-client-macros/Cargo.toml | grep -E "([+\-]){1}version" | wc -l)