Compare commits

...

8 Commits

Author SHA1 Message Date
Rik Huijzer 0d1f4568fc
Merge cdd6408fed into d8352f6b1d 2024-05-01 13:20:39 -07:00
David Tolnay d8352f6b1d
Move CARGO_HOME step in front of rustup install 2024-05-01 09:11:35 -07:00
David Tolnay 22eb75fbe0
Add description for CARGO_HOME step 2024-05-01 09:09:04 -07:00
David Tolnay e4e1c59547
Combine CARGO_HOME choice into a single step 2024-05-01 09:06:11 -07:00
David Tolnay b004a9e513
Merge pull request #108 from dariocurr/master
Add `CARGO_HOME` to `GITHUB_ENV`
2024-05-01 12:04:19 -04:00
Dario Curreri 18c33afdda
Add `CARGO_HOME` to `GITHUB_ENV` 2024-04-30 10:58:18 +02:00
Rik Huijzer cdd6408fed
Also apply suggestion to other examples 2023-06-26 09:47:06 +02:00
Rik Huijzer 10d4c2367f
Mention quotes for version 2023-06-26 09:43:29 +02:00
2 changed files with 10 additions and 3 deletions

View File

@ -43,6 +43,8 @@ All inputs are optional.
Rustup toolchain specifier e.g. <code>stable</code>, <code>nightly</code>, <code>1.42.0</code>, <code>nightly-2022-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.
<b>Also important: use quotes to ensure that the right toolchain version is passed to this GitHub Action.</b>
For example, specify <code>toolchain: '1.70'</code> (with quotes) because <code>toolchain: 1.70</code> will be parsed as <code>toolchain: 1.7</code>.
</td>
</tr>
<tr>
@ -86,7 +88,7 @@ compiler support.
# offset, which may be written in years, months, weeks, or days.
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable 18 months ago
toolchain: 'stable 18 months ago'
```
```yaml
@ -94,7 +96,7 @@ compiler support.
# the specified number of minor versions.
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable minus 8 releases
toolchain: 'stable minus 8 releases'
```
<br>

View File

@ -59,11 +59,16 @@ runs:
components: ${{inputs.components}}
shell: bash
- run: |
: set $CARGO_HOME
echo CARGO_HOME=${CARGO_HOME:-${{runner.os == 'Windows' && '$USERPROFILE' || '$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
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
echo "$CARGO_HOME/bin" >> $GITHUB_PATH
fi
if: runner.os != 'Windows'
shell: bash