mirror of
https://github.com/actions-rust-lang/setup-rust-toolchain.git
synced 2024-12-26 17:00:34 +01:00
Set environment variables before running rust-cache
This commit is contained in:
parent
8282e10527
commit
137d2d5a3a
2 changed files with 20 additions and 11 deletions
|
@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [1.2.1] - 2022-07-29
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
* Set environment variables before invoking the cache action.
|
||||||
|
This ensures restoring and saving are using the same cache key.
|
||||||
|
|
||||||
## [1.2.0] - 2022-07-21
|
## [1.2.0] - 2022-07-21
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
24
action.yml
24
action.yml
|
@ -50,6 +50,19 @@ runs:
|
||||||
targets: ${{inputs.target}}
|
targets: ${{inputs.target}}
|
||||||
components: ${{inputs.components}}
|
components: ${{inputs.components}}
|
||||||
shell: bash
|
shell: bash
|
||||||
|
# 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
|
||||||
|
shell: bash
|
||||||
|
- name: "Install Rust Problem Matcher"
|
||||||
|
run: echo "::add-matcher::${{ github.action_path }}/rust.json"
|
||||||
|
shell: bash
|
||||||
|
|
||||||
- name: Install rustup, if needed
|
- name: Install rustup, if needed
|
||||||
run: |
|
run: |
|
||||||
if ! command -v rustup &> /dev/null ; then
|
if ! command -v rustup &> /dev/null ; then
|
||||||
|
@ -88,14 +101,3 @@ runs:
|
||||||
|
|
||||||
- name: "Setup Rust Caching"
|
- name: "Setup Rust Caching"
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
- name: "Install Rust Problem Matcher"
|
|
||||||
run: echo "::add-matcher::${{ github.action_path }}/rust.json"
|
|
||||||
shell: bash
|
|
||||||
- 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
|
|
||||||
shell: bash
|
|
||||||
|
|
Loading…
Reference in a new issue