Skip to content

Commit

Permalink
Use dtolnay/rust-toolchain@stable action to install Rust toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
uklotzde committed Jan 28, 2024
1 parent d0d6274 commit 8976475
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ jobs:
library: ['hidraw', 'libusb']

steps:
- name: checkout repository and submodules
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y cmake libudev-dev libumockdev-dev umockdev
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build libusb
run: |
git clone https://github.com/libusb/libusb.git ./etc/libusb/
Expand Down Expand Up @@ -64,14 +66,16 @@ jobs:
env:
DEBIAN_FRONTEND: noninteractive
steps:
- name: checkout repository and submodules
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y libudev-dev
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build
run: cargo build --no-default-features --features linux-native --verbose
- name: Run tests
Expand All @@ -82,14 +86,12 @@ jobs:
build-windows:
runs-on: windows-latest
steps:
- name: checkout repository and submodules
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install rust environment
run: |
curl.exe --proto "=https" --tlsv1.2 -L -o rustup-init.exe https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe
.\rustup-init.exe -y
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build
run: cargo build --no-default-features --verbose
- name: Run tests
Expand All @@ -100,14 +102,12 @@ jobs:
build-windows-native:
runs-on: windows-latest
steps:
- name: checkout repository and submodules
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install rust environment
run: |
curl.exe --proto "=https" --tlsv1.2 -L -o rustup-init.exe https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe
.\rustup-init.exe -y
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build
run: cargo build --no-default-features --features windows-native --verbose
- name: Run tests
Expand All @@ -118,13 +118,12 @@ jobs:
build-macos:
runs-on: macos-latest
steps:
- name: checkout repository and submodules
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install rust environment
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build
run: cargo build --no-default-features --verbose
- name: Run tests
Expand All @@ -139,9 +138,13 @@ jobs:
DEBIAN_FRONTEND: noninteractive

steps:
- name: checkout repository and submodules
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
submodules: recursive
- name: fmt check
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check code formatting
run: cargo fmt --check

0 comments on commit 8976475

Please sign in to comment.