Skip to content

Commit

Permalink
CI: Respect selected toolchain (#291)
Browse files Browse the repository at this point in the history
The rust toolchain file overrides the Rust version selected in CI.
To allow testing different rust versions in CI, respect the toolchain
defined in CI.
  • Loading branch information
jschwe authored May 17, 2024
1 parent d848b1c commit b3b42f4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,27 +49,28 @@ jobs:
sudo apt update
sudo apt install gcc libxxf86vm-dev libosmesa6-dev libgles2-mesa-dev -y
- name: Install rust
id: toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Build target
if: matrix.target != 'default' && startsWith(matrix.target, 'aarch64-uwp-windows-msvc') != true
run: |
cd surfman
rustup target add ${{ matrix.target }}
cargo build --verbose ${{ matrix.features }} --target=${{ matrix.target }}
rustup +${{steps.toolchain.outputs.name}} target add ${{ matrix.target }}
cargo +${{steps.toolchain.outputs.name}} build --verbose ${{ matrix.features }} --target=${{ matrix.target }}
- name: Build
if: matrix.target == 'default'
run: |
cd surfman
cargo build --verbose ${{ matrix.features }}
cargo +${{steps.toolchain.outputs.name}} build --verbose ${{ matrix.features }}
- name: Build Windows
if: startsWith(matrix.target, 'aarch64-uwp-windows-msvc')
shell: cmd
run: |
cd surfman
rustup component add rust-src --target=aarch64-uwp-windows-msvc
cargo build -Z build-std --verbose --target=aarch64-uwp-windows-msvc
rustup +${{steps.toolchain.outputs.name}} component add rust-src --target=aarch64-uwp-windows-msvc
cargo +${{steps.toolchain.outputs.name}} build -Z build-std --verbose --target=aarch64-uwp-windows-msvc
Format:
name: Run `rustfmt`
runs-on: ubuntu-latest
Expand Down

0 comments on commit b3b42f4

Please sign in to comment.