dtolnay/rust-toolchain
Backtick shell command-substitution syntaxBasename is uppercase README.md
SHA-256557da930847620c8f29a14b0c2285e4ad7c97be174ca0afe719e542079efa9f2
Evidence
1# Install Rust Toolchain
2
3This GitHub Action installs a Rust toolchain using rustup. It is designed for
4one-line concise usage and good defaults.
5
6<br>
7
8## Example workflow
9
10```yaml
11name: test suite
12on: [push, pull_request]
13
14jobs:
⋯5 lines
20:41… ble
21 - run: cargo test --all-features
22```
23
24The selection of Rust toolchain is made based on the particular @rev of this
25Action being requested …
1#!/bin/bash
2
3cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.."
4
5if ! git diff-index --quiet HEAD; then
6 echo "Not running update-revs.sh because git working directory is dirty" >&2
7 exit 1
8fi
9
⋯9 lines
19}
20
21base=$(git rev-parse HEAD)
22push=()
23
24declare -A minor
25for rev in `releases`; do
26 minor[${rev%.*}]=$rev
27done
28
29for rev in `releases` stable beta nightly; do
30 echo "Updating $rev branch"
31 git checkout --quiet "$base"
32 git branch --quiet --delete --force $rev &>/dev/null || true
33 if [[ $rev == 1* ]]; then
34 sed -i "/^ toolchain:/,+2d; s/\${{inputs\.toolchain}}/$rev/" action.yml
35 else
36 sed -i "s/^ required: true$/ required: false\n default: $rev/" action.yml
37 fi
38 git add action.yml
39 git commit --quiet --message "toolchain: $rev"
40 git checkout --quiet -b $rev
41 push+=("$rev:refs/heads/$rev")
42 if [ "${minor[${rev%.*}]}" == $rev ]; then
43 push+=("$rev:refs/heads/${rev%.*}")
44 fi
45done
46
47for tool in clippy miri; do
48 echo "Updating $tool branch"
No evidence locations were recorded for this file. Raw result