Merge upstream/1.91.0: sync with version 1.91.0

This commit is contained in:
Alefh Sousa 2025-11-04 23:42:59 -03:00
commit bdda0dd655
4 changed files with 47 additions and 17 deletions

View file

@ -12,19 +12,19 @@ permissions:
jobs:
install:
name: Rust ${{matrix.rust}} on ${{matrix.os == 'ubuntu' && 'Linux' || matrix.os == 'macos' && 'macOS' || matrix.os == 'windows' && 'Windows' || '???'}}
runs-on: ${{matrix.os}}-latest
name: Rust ${{matrix.rust}} on ${{matrix.os}}
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
os: [ubuntu-latest, macos-latest, windows-latest, windows-11-arm, ubuntu-22.04-arm]
rust: [nightly, beta, stable, 1.62.0, stable 18 months ago, stable minus 8 releases]
include:
- os: ubuntu
- os: ubuntu-latest
rust: 1.0.0
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: ./
name: Run dtolnay/rust-toolchain${{contains(matrix.rust, ' ') && ' for ' || '@'}}${{matrix.rust}}
id: toolchain

View file

@ -16,15 +16,15 @@ jobs:
name: cargo test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --all-features
```
The selection of Rust toolchain is made based on the particular @rev of this
Action being requested. For example "dtolnay/rust-toolchain@nightly" pulls in
the nightly Rust toolchain, while "dtolnay/rust-toolchain@1.42.0" pulls in
1.42.0.
the nightly Rust toolchain, while "dtolnay/rust-toolchain@1.89.0" pulls in
1.89.0.
<br>
@ -40,7 +40,7 @@ All inputs are optional.
<tr>
<td><code>toolchain</code></td>
<td>
Rustup toolchain specifier e.g. <code>stable</code>, <code>nightly</code>, <code>1.42.0</code>, <code>nightly-2022-01-01</code>.
Rustup toolchain specifier e.g. <code>stable</code>, <code>nightly</code>, <code>1.89.0</code>, <code>nightly-2025-01-01</code>.
<b>Important: the default is to match the @rev as described above.</b>
When passing an explicit <code>toolchain</code> as an input instead of @rev, you'll want to use "dtolnay/rust-toolchain@master" as the revision of the action.
</td>
@ -66,7 +66,7 @@ All inputs are optional.
</tr>
<tr>
<td><code>cachekey</code></td>
<td>A short hash of the installed rustc version, appropriate for use as a cache key. <code>"20220627a831"</code></td>
<td>A short hash of the installed rustc version, appropriate for use as a cache key. <code>"20250627a831"</code></td>
</tr>
<tr>
<td><code>name</code></td>
@ -99,6 +99,18 @@ compiler support.
<br>
## Choice of full-length commit SHA
In a workflow that [pins the action][pin] using a full-length commit SHA (as
opposed to something like @nightly or @1.89.0) it is required that you pick a
SHA that is within the history of the master branch. Any commit that is not
within the history of master will eventually get garbage-collected and your
workflows will fail.
[pin]: https://docs.github.com/en/actions/reference/security/secure-use#using-third-party-actions
<br>
## License
The scripts and documentation in this project are released under the [MIT

View file

@ -30,7 +30,11 @@ runs:
- id: parse
run: |
: parse toolchain version
if [[ $toolchain =~ ^stable' '[0-9]+' '(year|month|week|day)s?' 'ago$ ]]; then
if [[ -z $toolchain ]]; then
# GitHub does not enforce `required: true` inputs itself. https://github.com/actions/runner/issues/1070
echo "'toolchain' is a required input" >&2
exit 1
elif [[ $toolchain =~ ^stable' '[0-9]+' '(year|month|week|day)s?' 'ago$ ]]; then
if [[ ${{runner.os}} == macOS ]]; then
echo "toolchain=1.$((($(date -v-$(sed 's/stable \([0-9]*\) \(.\).*/\1\2/' <<< $toolchain) +%s)/60/60/24-16569)/7/6))" >> $GITHUB_OUTPUT
else
@ -38,11 +42,13 @@ runs:
fi
elif [[ $toolchain =~ ^stable' 'minus' '[0-9]+' 'releases?$ ]]; then
echo "toolchain=1.$((($(date +%s)/60/60/24-16569)/7/6-${toolchain//[^0-9]/}))" >> $GITHUB_OUTPUT
elif [[ $toolchain =~ ^1\.[0-9]+$ ]]; then
echo "toolchain=1.$((i=${toolchain#1.}, c=($(date +%s)/60/60/24-16569)/7/6, i+9*i*(10*i<=c)+90*i*(100*i<=c)))" >> $GITHUB_OUTPUT
else
echo "toolchain=$toolchain" >> $GITHUB_OUTPUT
fi
env:
toolchain: 1.90.0
toolchain: 1.91.0
shell: bash
- id: flags
@ -58,24 +64,35 @@ runs:
- run: |
: set $CARGO_HOME
echo CARGO_HOME=${CARGO_HOME:-${{runner.os == 'Windows' && '$USERPROFILE' || '$HOME'}}/.cargo} >> $GITHUB_ENV
echo CARGO_HOME=${CARGO_HOME:-"${{runner.os == 'Windows' && '$USERPROFILE\.cargo' || '$HOME/.cargo'}}"} >> $GITHUB_ENV
shell: bash
- run: |
: install rustup if needed
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
fi
if: runner.os != 'Windows'
shell: bash
- run: |
: install rustup if needed on windows
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'
'${{runner.temp}}\rustup-init.exe' --default-toolchain none --no-modify-path -y
echo "$CARGO_HOME\bin" >> $GITHUB_PATH
fi
if: runner.os == 'Windows'
shell: bash
- name: rustup toolchain install ${{steps.parse.outputs.toolchain}}
run: rustup toolchain install ${{steps.parse.outputs.toolchain}}${{steps.flags.outputs.targets}}${{steps.flags.outputs.components}} --profile minimal${{steps.flags.outputs.downgrade}} --no-self-update
shell: bash
- run: rustup default ${{steps.parse.outputs.toolchain}}
shell: bash
continue-on-error: true # https://github.com/dtolnay/rust-toolchain/issues/127
- id: rustc-version
run: |

View file

@ -10,11 +10,12 @@ fi
patch_releases=(
1.12.1 1.15.1 1.22.1 1.24.1 1.26.1 1.26.2 1.27.1 1.27.2 1.29.1 1.29.2 1.30.1
1.31.1 1.34.1 1.34.2 1.41.1 1.43.1 1.44.1 1.45.1 1.45.2 1.52.1 1.56.1 1.58.1
1.62.1 1.66.1 1.67.1 1.68.1 1.68.2 1.71.1 1.72.1 1.74.1 1.77.1 1.77.2
1.62.1 1.66.1 1.67.1 1.68.1 1.68.2 1.71.1 1.72.1 1.74.1 1.77.1 1.77.2 1.80.1
1.84.1 1.85.1
)
releases() {
printf "%s\n" 1.{0..90}.0 ${patch_releases[@]} | sort -V
printf "%s\n" 1.{0..100}.0 ${patch_releases[@]} | sort -V
}
base=$(git rev-parse HEAD)
@ -32,7 +33,7 @@ for rev in `releases` stable beta nightly; do
if [[ $rev == 1* ]]; then
sed -i "/^ toolchain:/,+2d; s/\${{inputs\.toolchain}}/$rev/" action.yml
else
sed -i "s/required: true/required: false\n default: $rev/" action.yml
sed -i "s/^ required: true$/ required: false\n default: $rev/" action.yml
fi
git add action.yml
git commit --quiet --message "toolchain: $rev"