cache output files per branch for parallel builds

This commit is contained in:
Ritesh Chitlangi 2021-11-12 00:55:59 +08:00
parent c5e467b023
commit e78a4368ae
1 changed files with 15 additions and 10 deletions

View File

@ -19,8 +19,9 @@ steps:
- name: config - name: config
path: /root/.config/epp-client path: /root/.config/epp-client
commands: commands:
- export CARGO_HOME=/tmp/cargo - export CARGO_HOME=/tmp/cargo/$DRONE_BRANCH
- export CARGO_TARGET_DIR=/tmp/cargo-target - export CARGO_TARGET_DIR=/tmp/cargo-target/$DRONE_BRANCH
- mkdir -p $CARGO_HOME $CARGO_TARGET_DIR
- cargo check --all-targets - cargo check --all-targets
- name: fmt - name: fmt
@ -35,8 +36,9 @@ steps:
- name: config - name: config
path: /root/.config/epp-client path: /root/.config/epp-client
commands: commands:
- export CARGO_HOME=/tmp/cargo - export CARGO_HOME=/tmp/cargo/$DRONE_BRANCH
- export CARGO_TARGET_DIR=/tmp/cargo-target - export CARGO_TARGET_DIR=/tmp/cargo-target/$DRONE_BRANCH
- mkdir -p $CARGO_HOME $CARGO_TARGET_DIR
- cargo fmt --all -- --check - cargo fmt --all -- --check
- name: clippy - name: clippy
@ -51,8 +53,9 @@ steps:
- name: config - name: config
path: /root/.config/epp-client path: /root/.config/epp-client
commands: commands:
- export CARGO_HOME=/tmp/cargo - export CARGO_HOME=/tmp/cargo/$DRONE_BRANCH
- export CARGO_TARGET_DIR=/tmp/cargo-target - export CARGO_TARGET_DIR=/tmp/cargo-target/$DRONE_BRANCH
- mkdir -p $CARGO_HOME $CARGO_TARGET_DIR
- cargo clippy --workspace --all-targets -- -D warnings - cargo clippy --workspace --all-targets -- -D warnings
- name: test - name: test
@ -67,8 +70,9 @@ steps:
- name: config - name: config
path: /root/.config/epp-client path: /root/.config/epp-client
commands: commands:
- export CARGO_HOME=/tmp/cargo - export CARGO_HOME=/tmp/cargo/$DRONE_BRANCH
- export CARGO_TARGET_DIR=/tmp/cargo-target - export CARGO_TARGET_DIR=/tmp/cargo-target/$DRONE_BRANCH
- mkdir -p $CARGO_HOME $CARGO_TARGET_DIR
- cargo test -- --nocapture - cargo test -- --nocapture
- name: crates.io - name: crates.io
@ -85,8 +89,9 @@ steps:
- name: crates - name: crates
path: /root/.cargo path: /root/.cargo
commands: commands:
- export CARGO_HOME=/tmp/cargo - export CARGO_HOME=/tmp/cargo/$DRONE_BRANCH
- export CARGO_TARGET_DIR=/tmp/cargo-target - 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) - 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 - 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) - export EPP_CLIENT_MACROS_VERSION_CHANGE=$(git diff HEAD^ HEAD -- epp-client-macros/Cargo.toml | grep -E "([+\-]){1}version" | wc -l)