mirror of
https://github.com/actions-rust-lang/setup-rust-toolchain.git
synced 2024-12-26 00:52:17 +01:00
test: add toolchain file override test
This commit is contained in:
parent
d473183fe9
commit
c6086ae6e5
1 changed files with 24 additions and 7 deletions
31
.github/workflows/ci.yml
vendored
31
.github/workflows/ci.yml
vendored
|
@ -12,8 +12,15 @@ jobs:
|
|||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- windows-latest
|
||||
- macos-latest
|
||||
write-toolchain-file:
|
||||
- false
|
||||
- true
|
||||
rust:
|
||||
# Test with toolchain file override
|
||||
# use stable toolchain as default
|
||||
- null
|
||||
|
||||
# Test that the sparse registry check works.
|
||||
|
@ -23,21 +30,17 @@ jobs:
|
|||
- "nightly"
|
||||
- "beta"
|
||||
- "stable"
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- windows-latest
|
||||
- macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# Test toolchain file support
|
||||
- name: Write rust-toolchain.toml
|
||||
if: matrix.rust == null
|
||||
if: matrix.write-toolchain-file
|
||||
shell: bash
|
||||
run: |
|
||||
cat <<EOF >>rust-toolchain.toml
|
||||
[toolchain]
|
||||
channel = "nightly-2024-01-11"
|
||||
channel = "nightly-2024-01-10"
|
||||
components = [ "rustfmt", "rustc-dev" ]
|
||||
targets = [ "wasm32-unknown-unknown", "thumbv7m-none-eabi" ]
|
||||
profile = "minimal"
|
||||
|
@ -59,6 +62,20 @@ jobs:
|
|||
- name: Check ${{'${{steps.toolchain.outputs.rustup-version}}'}}
|
||||
run: echo '${{steps.toolchain.outputs.rustup-version}}'
|
||||
|
||||
- name: Check lack of toolchain input or file results in stable
|
||||
if: !matrix.write-toolchain-file && matrix.rust == null
|
||||
shell: bash
|
||||
run: |-
|
||||
rustcv="$(rustc --version)"
|
||||
[[ "$rustcv" != *"nightly"* && "$rustcv" != *"beta"* ]]
|
||||
|
||||
- name: Check toolchain file is being overridden
|
||||
if: matrix.write-toolchain-file
|
||||
shell: bash
|
||||
run: |-
|
||||
rustcv="$(rustc --version)"
|
||||
[[ ! ( "$rustcv" == *"nightly"* && "$rustcv" == *"2024-01-10"* ) ]]
|
||||
|
||||
- shell: bash
|
||||
run: rustc --version && cargo --version
|
||||
|
||||
|
|
Loading…
Reference in a new issue