mirror of
https://github.com/dtolnay/rust-toolchain.git
synced 2026-08-24 00:00:27 +02:00
Compare commits
1
Commits
1.79
..
3d4ddd71f9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d4ddd71f9 |
+21
-22
@@ -28,8 +28,8 @@ runs:
|
|||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- id: parse
|
- id: parse
|
||||||
name: Parse toolchain version
|
|
||||||
run: |
|
run: |
|
||||||
|
: parse toolchain version
|
||||||
if [[ -z $toolchain ]]; then
|
if [[ -z $toolchain ]]; then
|
||||||
# GitHub does not enforce `required: true` inputs itself. https://github.com/actions/runner/issues/1070
|
# GitHub does not enforce `required: true` inputs itself. https://github.com/actions/runner/issues/1070
|
||||||
echo "'toolchain' is a required input" >&2
|
echo "'toolchain' is a required input" >&2
|
||||||
@@ -48,12 +48,12 @@ runs:
|
|||||||
echo "toolchain=$toolchain" >> $GITHUB_OUTPUT
|
echo "toolchain=$toolchain" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
env:
|
env:
|
||||||
toolchain: 1.79.0
|
toolchain: 1.28.0
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- id: flags
|
- id: flags
|
||||||
name: Construct rustup command line
|
|
||||||
run: |
|
run: |
|
||||||
|
: construct rustup command line
|
||||||
echo "targets=$(for t in ${targets//,/ }; do echo -n ' --target' $t; done)" >> $GITHUB_OUTPUT
|
echo "targets=$(for t in ${targets//,/ }; do echo -n ' --target' $t; done)" >> $GITHUB_OUTPUT
|
||||||
echo "components=$(for c in ${components//,/ }; do echo -n ' --component' $c; done)" >> $GITHUB_OUTPUT
|
echo "components=$(for c in ${components//,/ }; do echo -n ' --component' $c; done)" >> $GITHUB_OUTPUT
|
||||||
echo "downgrade=${{steps.parse.outputs.toolchain == 'nightly' && inputs.components && ' --allow-downgrade' || ''}}" >> $GITHUB_OUTPUT
|
echo "downgrade=${{steps.parse.outputs.toolchain == 'nightly' && inputs.components && ' --allow-downgrade' || ''}}" >> $GITHUB_OUTPUT
|
||||||
@@ -62,12 +62,13 @@ runs:
|
|||||||
components: ${{inputs.components}}
|
components: ${{inputs.components}}
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Set $CARGO_HOME
|
- run: |
|
||||||
run: echo CARGO_HOME=${CARGO_HOME:-"${{runner.os == 'Windows' && '$USERPROFILE\.cargo' || '$HOME/.cargo'}}"} >> $GITHUB_ENV
|
: set $CARGO_HOME
|
||||||
|
echo CARGO_HOME=${CARGO_HOME:-"${{runner.os == 'Windows' && '$USERPROFILE\.cargo' || '$HOME/.cargo'}}"} >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Install rustup if needed
|
- run: |
|
||||||
run: |
|
: install rustup if needed
|
||||||
if ! command -v rustup &>/dev/null; then
|
if ! command -v rustup &>/dev/null; then
|
||||||
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail https://sh.rustup.rs | sh -s -- --default-toolchain none -y
|
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail https://sh.rustup.rs | sh -s -- --default-toolchain none -y
|
||||||
echo "$CARGO_HOME/bin" >> $GITHUB_PATH
|
echo "$CARGO_HOME/bin" >> $GITHUB_PATH
|
||||||
@@ -75,8 +76,8 @@ runs:
|
|||||||
if: runner.os != 'Windows'
|
if: runner.os != 'Windows'
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Install rustup if needed on windows
|
- run: |
|
||||||
run: |
|
: install rustup if needed on windows
|
||||||
if ! command -v rustup &>/dev/null; then
|
if ! command -v rustup &>/dev/null; then
|
||||||
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail https://win.rustup.rs/${{runner.arch == 'ARM64' && 'aarch64' || 'x86_64'}} --output '${{runner.temp}}\rustup-init.exe'
|
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail https://win.rustup.rs/${{runner.arch == 'ARM64' && 'aarch64' || 'x86_64'}} --output '${{runner.temp}}\rustup-init.exe'
|
||||||
'${{runner.temp}}\rustup-init.exe' --default-toolchain none --no-modify-path -y
|
'${{runner.temp}}\rustup-init.exe' --default-toolchain none --no-modify-path -y
|
||||||
@@ -91,35 +92,34 @@ runs:
|
|||||||
RUSTUP_PERMIT_COPY_RENAME: 1
|
RUSTUP_PERMIT_COPY_RENAME: 1
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: rustup default ${{steps.parse.outputs.toolchain}}
|
- run: rustup default ${{steps.parse.outputs.toolchain}}
|
||||||
run: rustup default ${{steps.parse.outputs.toolchain}}
|
|
||||||
shell: bash
|
shell: bash
|
||||||
continue-on-error: true # https://github.com/dtolnay/rust-toolchain/issues/127
|
continue-on-error: true # https://github.com/dtolnay/rust-toolchain/issues/127
|
||||||
|
|
||||||
- id: rustc-version
|
- id: rustc-version
|
||||||
name: Create cachekey
|
|
||||||
run: |
|
run: |
|
||||||
|
: create cachekey
|
||||||
DATE=$(rustc +${{steps.parse.outputs.toolchain}} --version --verbose | sed -ne 's/^commit-date: \(20[0-9][0-9]\)-\([01][0-9]\)-\([0-3][0-9]\)$/\1\2\3/p')
|
DATE=$(rustc +${{steps.parse.outputs.toolchain}} --version --verbose | sed -ne 's/^commit-date: \(20[0-9][0-9]\)-\([01][0-9]\)-\([0-3][0-9]\)$/\1\2\3/p')
|
||||||
HASH=$(rustc +${{steps.parse.outputs.toolchain}} --version --verbose | sed -ne 's/^commit-hash: //p')
|
HASH=$(rustc +${{steps.parse.outputs.toolchain}} --version --verbose | sed -ne 's/^commit-hash: //p')
|
||||||
echo "cachekey=$(echo $DATE$HASH | head -c12)" >> $GITHUB_OUTPUT
|
echo "cachekey=$(echo $DATE$HASH | head -c12)" >> $GITHUB_OUTPUT
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Disable incremental compilation
|
- run: |
|
||||||
run: |
|
: disable incremental compilation
|
||||||
if [ -z "${CARGO_INCREMENTAL+set}" ]; then
|
if [ -z "${CARGO_INCREMENTAL+set}" ]; then
|
||||||
echo CARGO_INCREMENTAL=0 >> $GITHUB_ENV
|
echo CARGO_INCREMENTAL=0 >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Enable colors in Cargo output
|
- run: |
|
||||||
run: |
|
: enable colors in Cargo output
|
||||||
if [ -z "${CARGO_TERM_COLOR+set}" ]; then
|
if [ -z "${CARGO_TERM_COLOR+set}" ]; then
|
||||||
echo CARGO_TERM_COLOR=always >> $GITHUB_ENV
|
echo CARGO_TERM_COLOR=always >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Enable Cargo sparse registry
|
- run: |
|
||||||
run: |
|
: enable Cargo sparse registry
|
||||||
# implemented in 1.66, stabilized in 1.68, made default in 1.70
|
# implemented in 1.66, stabilized in 1.68, made default in 1.70
|
||||||
if [ -z "${CARGO_REGISTRIES_CRATES_IO_PROTOCOL+set}" -o -f "${{runner.temp}}"/.implicit_cargo_registries_crates_io_protocol ]; then
|
if [ -z "${CARGO_REGISTRIES_CRATES_IO_PROTOCOL+set}" -o -f "${{runner.temp}}"/.implicit_cargo_registries_crates_io_protocol ]; then
|
||||||
if rustc +${{steps.parse.outputs.toolchain}} --version --verbose | grep -q '^release: 1\.6[89]\.'; then
|
if rustc +${{steps.parse.outputs.toolchain}} --version --verbose | grep -q '^release: 1\.6[89]\.'; then
|
||||||
@@ -132,14 +132,13 @@ runs:
|
|||||||
fi
|
fi
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Work around spurious network errors in curl 8.0
|
- run: |
|
||||||
run: |
|
: work around spurious network errors in curl 8.0
|
||||||
# https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/timeout.20investigation
|
# https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/timeout.20investigation
|
||||||
if rustc +${{steps.parse.outputs.toolchain}} --version --verbose | grep -q '^release: 1\.7[01]\.'; then
|
if rustc +${{steps.parse.outputs.toolchain}} --version --verbose | grep -q '^release: 1\.7[01]\.'; then
|
||||||
echo CARGO_HTTP_MULTIPLEXING=false >> $GITHUB_ENV
|
echo CARGO_HTTP_MULTIPLEXING=false >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: rustc +${{steps.parse.outputs.toolchain}} --version --verbose
|
- run: rustc +${{steps.parse.outputs.toolchain}} --version --verbose
|
||||||
run: rustc +${{steps.parse.outputs.toolchain}} --version --verbose
|
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
Reference in New Issue
Block a user