From e77a91fd6f10bb035084aa77e98d9982556a5fad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Fri, 31 Jan 2025 14:38:20 +0100 Subject: [PATCH 1/3] Delegate smaller tasks to mac runner --- .github/workflows/ci.yml | 29 +++++++++++++++++------------ .github/workflows/hil.yml | 2 +- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48da9ed780d..d0459abe200 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,7 +88,7 @@ jobs: toolchain: ${{ matrix.device.toolchain }} extras: - runs-on: ubuntu-latest + runs-on: macos-m1-self-hosted steps: - uses: actions/checkout@v4 @@ -97,8 +97,6 @@ jobs: toolchain: stable - uses: Swatinem/rust-cache@v2 - - name: Install dependencies - run: sudo apt-get update && sudo apt-get -y install musl-tools libudev-dev pkg-config # Build the extra crates - name: Build the bench-server run: cd extras/bench-server && cargo build @@ -111,21 +109,28 @@ jobs: # MSRV msrv: - runs-on: ubuntu-latest - env: - RUSTC_BOOTSTRAP: 1 + runs-on: macos-m1-self-hosted steps: - uses: actions/checkout@v4 - - uses: esp-rs/xtensa-toolchain@v1.5 - with: - ldproxy: false - version: ${{ env.MSRV }} - uses: dtolnay/rust-toolchain@v1 with: target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf toolchain: ${{ env.MSRV }} components: rust-src + - name: install esp toolchain + run: | + if [ ! -f "$HOME/.cargo/bin/espup" ]; then + curl -L https://github.com/esp-rs/espup/releases/latest/download/espup-aarch64-apple-darwin -o "$HOME/.cargo/bin/espup" + chmod a+x "$HOME/.cargo/bin/espup" + fi + + source "$HOME/.cargo/env" + "$HOME/.cargo/bin/espup" install -l debug --export-file $HOME/exports --targets all --toolchain-version 1.84.0.0 + source "$HOME/exports" + echo "$PATH" >> "$GITHUB_PATH" + echo "LIBCLANG_PATH=${LIBCLANG_PATH}" >> "$GITHUB_ENV" + rustup override unset - uses: Swatinem/rust-cache@v2 # Verify the MSRV for all RISC-V chips. @@ -166,7 +171,7 @@ jobs: # Format rustfmt: - runs-on: ubuntu-latest + runs-on: macos-m1-self-hosted steps: - uses: actions/checkout@v4 @@ -185,7 +190,7 @@ jobs: # host tests host-tests: - runs-on: ubuntu-latest + runs-on: macos-m1-self-hosted steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/hil.yml b/.github/workflows/hil.yml index 2541c40da72..04a36322483 100644 --- a/.github/workflows/hil.yml +++ b/.github/workflows/hil.yml @@ -30,7 +30,7 @@ env: jobs: build-xtasks: name: Build xtasks | ${{ matrix.host.arch }} - runs-on: ubuntu-latest + runs-on: macos-m1-self-hosted strategy: fail-fast: false From 374f316f851a019a4334fdb965ded5772f4221d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Fri, 31 Jan 2025 14:51:12 +0100 Subject: [PATCH 2/3] Build xtasks on the same runner --- .github/workflows/hil.yml | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/hil.yml b/.github/workflows/hil.yml index 04a36322483..bfb993750f1 100644 --- a/.github/workflows/hil.yml +++ b/.github/workflows/hil.yml @@ -29,17 +29,8 @@ env: jobs: build-xtasks: - name: Build xtasks | ${{ matrix.host.arch }} - runs-on: macos-m1-self-hosted - - strategy: - fail-fast: false - matrix: - host: - - arch: armv7 - rust-target: armv7-unknown-linux-gnueabihf - - arch: aarch64 - rust-target: aarch64-unknown-linux-gnu + name: Build xtasks + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -60,13 +51,21 @@ jobs: run: cargo install cross - name: Build xtasks - run: cross build --release --target ${{ matrix.host.rust-target }} -p xtask + run: | + cross build --release --target armv7-unknown-linux-gnueabihf -p xtask + cross build --release --target aarch64-unknown-linux-gnu -p xtask + + - name: Upload artifact | armv7-unknown-linux-gnueabihf + uses: actions/upload-artifact@v4 + with: + name: xtask-armv7 + path: target/armv7-unknown-linux-gnueabihf/release/xtask - - name: Upload artifact + - name: Upload artifact | aarch64-unknown-linux-gnu uses: actions/upload-artifact@v4 with: - name: xtask-${{ matrix.host.arch }} - path: target/${{ matrix.host.rust-target }}/release/xtask + name: xtask-aarch64 + path: target/aarch64-unknown-linux-gnu/release/xtask build-tests: name: Build HIL Tests | ${{ matrix.target.soc }} From a3a0468fc126c7c7caecbebcbe7d3a877b3ed635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Mon, 3 Feb 2025 09:33:22 +0100 Subject: [PATCH 3/3] Test the toolchian action --- .github/workflows/ci.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0459abe200..b4532589575 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,24 +113,15 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: esp-rs/xtensa-toolchain@v1.5 + with: + ldproxy: false + version: ${{ env.MSRV }} - uses: dtolnay/rust-toolchain@v1 with: target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf toolchain: ${{ env.MSRV }} components: rust-src - - name: install esp toolchain - run: | - if [ ! -f "$HOME/.cargo/bin/espup" ]; then - curl -L https://github.com/esp-rs/espup/releases/latest/download/espup-aarch64-apple-darwin -o "$HOME/.cargo/bin/espup" - chmod a+x "$HOME/.cargo/bin/espup" - fi - - source "$HOME/.cargo/env" - "$HOME/.cargo/bin/espup" install -l debug --export-file $HOME/exports --targets all --toolchain-version 1.84.0.0 - source "$HOME/exports" - echo "$PATH" >> "$GITHUB_PATH" - echo "LIBCLANG_PATH=${LIBCLANG_PATH}" >> "$GITHUB_ENV" - rustup override unset - uses: Swatinem/rust-cache@v2 # Verify the MSRV for all RISC-V chips.