-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace deprecated workflow functions (#1108)
- Loading branch information
Showing
19 changed files
with
110 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,16 +4,23 @@ inputs: | |
target: | ||
description: 'Additionally install specified target for this toolchain, ex. x86_64-apple-darwin' | ||
required: false | ||
profile: | ||
description: 'Execute rustup set profile {value} before installing the toolchain, ex. minimal' | ||
toolchain: | ||
description: 'Toolchain to install. Default: stable.' | ||
required: false | ||
default: stable | ||
components: | ||
description: 'Comma-separated string of additional components to install e.g. `clippy`, `rustfmt`' | ||
required: false | ||
default: 'minimal' | ||
os: | ||
description: 'OS of the runner, used for cache key construction.' | ||
required: true | ||
job: | ||
description: 'Name of the job, used for cache key construction.' | ||
required: true | ||
cargo-cache-enabled: | ||
description: 'Cache cargo folder. Default: false.' | ||
required: false | ||
default: '' | ||
target-cache-enabled: | ||
description: 'Cache build artifacts from the target path. Default: false.' | ||
required: false | ||
|
@@ -33,26 +40,25 @@ runs: | |
using: "composite" | ||
steps: | ||
|
||
- name: Get current date linux / macos | ||
if: inputs.os == 'macos-latest' || inputs.os == 'ubuntu-latest' | ||
shell: sh | ||
- name: Get current date | ||
shell: bash | ||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | ||
|
||
- name: Get current date windows | ||
if: inputs.os == 'windows-latest' | ||
shell: pwsh | ||
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
|
||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
uses: dtolnay/rust-toolchain@9cd00a88a73addc8617065438eff914dd08d0955 | ||
id: toolchain | ||
with: | ||
toolchain: stable | ||
override: true | ||
profile: ${{ inputs.profile }} | ||
target: ${{ inputs.target }} | ||
toolchain: ${{ inputs.toolchain }} | ||
targets: ${{ inputs.target }} | ||
components: ${{ inputs.components }} | ||
|
||
- name: Override toolchain | ||
shell: bash | ||
run: rustup override set ${{ steps.toolchain.outputs.name }} | ||
|
||
- name: Cache cargo | ||
uses: actions/[email protected] | ||
if: inputs.cargo-cache-enabled == 'true' | ||
with: | ||
# https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci | ||
path: | | ||
|
@@ -72,9 +78,8 @@ runs: | |
# Allows dependencies updated on crates.io between runs to trigger storing an updated cache, | ||
# which hashing Cargo.toml files alone does not. | ||
- name: Cargo update | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: update | ||
run: cargo update | ||
shell: bash | ||
|
||
- name: Cache build target | ||
uses: actions/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.