Only set env vars if they are unset.
This commit is contained in:
parent
dfa8744db3
commit
045ad9ff3f
|
@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
* Only set environment variables, if they are not set before.
|
||||||
|
This allows setting environment variables before using this action and keeping their values.
|
||||||
|
|
||||||
## [1.3.7] - 2023-01-31
|
## [1.3.7] - 2023-01-31
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
24
action.yml
24
action.yml
|
@ -57,15 +57,27 @@ runs:
|
||||||
# The environment variables always need to be set before the caching action
|
# The environment variables always need to be set before the caching action
|
||||||
- name: "Setting Environment Variables"
|
- name: "Setting Environment Variables"
|
||||||
run: |
|
run: |
|
||||||
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV
|
if [[ ! -v CARGO_INCREMENTAL ]]; then
|
||||||
echo "CARGO_PROFILE_DEV_DEBUG=0" >> $GITHUB_ENV
|
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV
|
||||||
echo "CARGO_TERM_COLOR=always" >> $GITHUB_ENV
|
fi
|
||||||
echo "RUST_BACKTRACE=short" >> $GITHUB_ENV
|
if [[ ! -v CARGO_PROFILE_DEV_DEBUG ]]; then
|
||||||
echo "RUSTFLAGS=-D warnings" >> $GITHUB_ENV
|
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
|
# Enable faster sparse index on nightly
|
||||||
# The value is ignored on stable and causes no problems
|
# The value is ignored on stable and causes no problems
|
||||||
# https://internals.rust-lang.org/t/call-for-testing-cargo-sparse-registry/16862
|
# 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
|
# Enable sparse index after stabilization
|
||||||
# This causes warnings on stable 1.67, e.g., when using "cargo add"
|
# This causes warnings on stable 1.67, e.g., when using "cargo add"
|
||||||
# https://github.com/rust-lang/cargo/pull/11224
|
# https://github.com/rust-lang/cargo/pull/11224
|
||||||
|
|
Loading…
Reference in New Issue