-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Description Set some environment variables that reduce size on disk and make the build a little faster. Also, read the toolchain from the `rust-toolchain` file, so it's not duplicated in every workflow. Ported over from the `turbo` repo.
- Loading branch information
1 parent
675dec0
commit ded5492
Showing
7 changed files
with
141 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: 'Rust Setup' | ||
description: 'Sets up the Rust toolchain for CI' | ||
inputs: | ||
targets: | ||
description: 'Comma-separated list of target triples to install for this toolchain' | ||
required: false | ||
components: | ||
description: 'Comma-separated list of components to be additionally installed' | ||
required: false | ||
skip-install: | ||
description: 'Sets environment variables without installing the rust toolchain' | ||
required: false | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: 'Get toolchain version from file' | ||
id: file | ||
shell: bash | ||
run: echo "toolchain=$(cat ./rust-toolchain)" >> $GITHUB_OUTPUT | ||
|
||
- shell: bash | ||
run: | | ||
: force toolchain version | ||
echo "RUST_TOOLCHAIN=${{ steps.file.outputs.toolchain }}" >> $GITHUB_ENV | ||
- shell: bash | ||
run: | | ||
: disable incremental compilation | ||
if [ -z "${CARGO_INCREMENTAL+set}" ]; then | ||
echo CARGO_INCREMENTAL=0 >> $GITHUB_ENV | ||
fi | ||
- shell: bash | ||
run: | | ||
: enable colors in Cargo output | ||
if [ -z "${CARGO_TERM_COLOR+set}" ]; then | ||
echo CARGO_TERM_COLOR=always >> $GITHUB_ENV | ||
fi | ||
- shell: bash | ||
run: | | ||
: enable rust backtrace | ||
if [ -z "${RUST_BACKTRACE+set}" ]; then | ||
echo RUST_BACKTRACE=short >> $GITHUB_ENV | ||
fi | ||
- shell: bash | ||
run: | | ||
: enable faster cargo sparse registry | ||
if [ -z "${CARGO_REGISTRIES_CRATES_IO_PROTOCOL+set}" ]; then | ||
echo CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse >> $GITHUB_ENV | ||
fi | ||
- name: 'Setup Rust toolchain' | ||
uses: dtolnay/rust-toolchain@master | ||
if: ${{ !inputs.skip-install }} | ||
with: | ||
toolchain: ${{ steps.file.outputs.toolchain }} | ||
targets: ${{ inputs.targets }} | ||
components: ${{ inputs.components }} | ||
|
||
- name: 'Add cargo problem matchers' | ||
shell: bash | ||
run: echo "::add-matcher::${{ github.action_path }}/matchers.json" |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"problemMatcher": [ | ||
{ | ||
"owner": "cargo-common", | ||
"pattern": [ | ||
{ | ||
"regexp": "^(warning|warn|error)(?:\\[(\\S*)\\])?: (.*)$", | ||
"severity": 1, | ||
"code": 2, | ||
"message": 3 | ||
}, | ||
{ | ||
"regexp": "^(?:[\\s->=]*(.*):(\\d*):(\\d*)|.*)$", | ||
"file": 1, | ||
"line": 2, | ||
"column": 3 | ||
} | ||
] | ||
}, | ||
{ | ||
"owner": "cargo-test", | ||
"pattern": [ | ||
{ | ||
"regexp": "^.*panicked\\s+at\\s+'(.*)',\\s+(.*):(\\d+):(\\d+)$", | ||
"message": 1, | ||
"file": 2, | ||
"line": 3, | ||
"column": 4 | ||
} | ||
] | ||
}, | ||
{ | ||
"owner": "rustfmt", | ||
"pattern": [ | ||
{ | ||
"regexp": "^(Diff in (\\S+)) at line (\\d+):", | ||
"message": 1, | ||
"file": 2, | ||
"line": 3 | ||
} | ||
] | ||
} | ||
] | ||
} |
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