Skip to content

Commit

Permalink
Use composite action
Browse files Browse the repository at this point in the history
  • Loading branch information
Urhengulas committed May 13, 2024
1 parent 55371db commit bae9ace
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
14 changes: 14 additions & 0 deletions .github/actions/update-rust/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "Update Rust"
description: "Update the Rust toolchain"
inputs:
toolchain:
required: true
default: "stable"
description: "The toolchain channel or version to use"
runs:
using: "composite"
steps:
- run: rustup update --no-self-update ${{ inputs.toolchain }}
shell: bash
- run: rustup default ${{ inputs.toolchain }}
shell: bash
30 changes: 9 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Use the latest stable release
run: |
rustup update --no-self-update stable
rustup default stable
uses: ./.github/actions/update-rust
- name: Install C libraries for tooling on ubuntu
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update && sudo apt-get install libudev-dev libusb-1.0-0-dev
Expand All @@ -40,9 +38,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Use the latest stable release
run: |
rustup update --no-self-update stable
rustup default stable
uses: ./.github/actions/update-rust
- name: Install Rust targets, build defmt crates for no_std targets, build defmt dependent crates for cortex-m targets, build panic-probe with different features
run: cargo xtask test-cross

Expand All @@ -52,9 +48,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Use the latest stable release
run: |
rustup update --no-self-update stable
rustup default stable
uses: ./.github/actions/update-rust
- name: Run rustfmt & clippy
run: cargo xtask test-lint

Expand All @@ -63,9 +57,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Use the latest stable release
run: |
rustup update --no-self-update stable
rustup default stable
uses: ./.github/actions/update-rust
- name: Install Rust stable, run all UI tests on the host
run: cargo xtask test-ui

Expand All @@ -75,9 +67,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Use the latest stable release
run: |
rustup update --no-self-update stable
rustup default stable
uses: ./.github/actions/update-rust
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
Expand All @@ -95,9 +85,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Use the latest ${{ matrix.toolchain }} release
run: |
rustup update --no-self-update ${{ matrix.toolchain }}
rustup default ${{ matrix.toolchain }}
uses: ./.github/actions/update-rust
with:
toolchain: ${{ matrix.toolchain }}
- name: Install QEMU_TARGET
run: rustup target add ${{ env.QEMU_TARGET }}
- name: Install dependencies
Expand All @@ -112,9 +102,7 @@ jobs:
with:
fetch-depth: 0
- name: Use the latest stable release
run: |
rustup update --no-self-update stable
rustup default stable
uses: ./.github/actions/update-rust
- name: Install QEMU_TARGET
run: rustup target add ${{ env.QEMU_TARGET }}
- name: Install dependencies
Expand Down

0 comments on commit bae9ace

Please sign in to comment.