Only set env vars if they are unset.
This commit is contained in:
parent
dfa8744db3
commit
045ad9ff3f
2 changed files with 23 additions and 6 deletions
24
action.yml
24
action.yml
|
@ -57,15 +57,27 @@ runs:
|
|||
# The environment variables always need to be set before the caching action
|
||||
- name: "Setting Environment Variables"
|
||||
run: |
|
||||
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV
|
||||
echo "CARGO_PROFILE_DEV_DEBUG=0" >> $GITHUB_ENV
|
||||
echo "CARGO_TERM_COLOR=always" >> $GITHUB_ENV
|
||||
echo "RUST_BACKTRACE=short" >> $GITHUB_ENV
|
||||
echo "RUSTFLAGS=-D warnings" >> $GITHUB_ENV
|
||||
if [[ ! -v CARGO_INCREMENTAL ]]; then
|
||||
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV
|
||||
fi
|
||||
if [[ ! -v CARGO_PROFILE_DEV_DEBUG ]]; then
|
||||
echo "CARGO_PROFILE_DEV_DEBUG=0" >> $GITHUB_ENV
|
||||
fi
|
||||
if [[ ! -v CARGO_TERM_COLOR ]]; then
|
||||
echo "CARGO_TERM_COLOR=always" >> $GITHUB_ENV
|
||||
fi
|
||||
if [[ ! -v RUST_BACKTRACE ]]; then
|
||||
echo "RUST_BACKTRACE=short" >> $GITHUB_ENV
|
||||
fi
|
||||
if [[ ! -v RUSTFLAGS ]]; then
|
||||
echo "RUSTFLAGS=-D warnings" >> $GITHUB_ENV
|
||||
fi
|
||||
# Enable faster sparse index on nightly
|
||||
# The value is ignored on stable and causes no problems
|
||||
# https://internals.rust-lang.org/t/call-for-testing-cargo-sparse-registry/16862
|
||||
echo "CARGO_UNSTABLE_SPARSE_REGISTRY=true" >> $GITHUB_ENV
|
||||
if [[ ! -v CARGO_UNSTABLE_SPARSE_REGISTRY ]]; then
|
||||
echo "CARGO_UNSTABLE_SPARSE_REGISTRY=true" >> $GITHUB_ENV
|
||||
fi
|
||||
# Enable sparse index after stabilization
|
||||
# This causes warnings on stable 1.67, e.g., when using "cargo add"
|
||||
# https://github.com/rust-lang/cargo/pull/11224
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue