Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- main

jobs:
tests:
test-linux:
runs-on: ubuntu-latest

strategy:
Expand Down Expand Up @@ -39,3 +39,34 @@ jobs:
- run: cargo fmt --check
- run: cargo check
- run: cargo build --release

test-windows:
runs-on: windows-latest

strategy:
matrix:
toolchain:
- stable-x86_64-pc-windows-msvc
- stable-i686-pc-windows-msvc
use-cache:
- true
- false

defaults:
run:
working-directory: tests

steps:
- uses: actions/checkout@v6

- uses: ./
with:
toolchain: ${{ matrix.toolchain }}
force-non-host: true
use-cache: ${{ matrix.use-cache }}
components: rustfmt
workspaces: tests

- run: cargo fmt --check
- run: cargo check
- run: cargo build --release
17 changes: 16 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ inputs:
components:
description: Comma separated list of additional components.
required: false
force-non-host:
description: Allow non-host toolchain to be installed.
default: false
required: false
use-cache:
description: Use rust-cache.
default: true
Expand All @@ -33,13 +37,24 @@ runs:
if [[ -n "$COMPONENTS" ]]; then
set -- "$@" --component "$COMPONENTS"
fi
if "$FORCE_NON_HOST"; then
set -- "$@" --force-non-host
fi
set -x
rustup toolchain install "$@" --no-self-update
rustup default "$TOOLCHAIN"

set +x
set -- "$TOOLCHAIN"
if "$FORCE_NON_HOST"; then
set -- "$@" --force-non-host
fi
set -x
rustup default "$@"
env:
TOOLCHAIN: ${{ inputs.toolchain }}
PROFILE: ${{ inputs.profile }}
COMPONENTS: ${{ inputs.components }}
FORCE_NON_HOST: ${{ case(inputs.force-non-host == 'true', 'true', 'false') }}
shell: bash

- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
Expand Down