Skip to content

Commit

Permalink
ci: Use a matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioGasquez committed Mar 18, 2024
1 parent ffe61e8 commit f713d01
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 86 deletions.
88 changes: 19 additions & 69 deletions .github/workflows/hil.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,76 +11,26 @@ env:
CARGO_TERM_COLOR: always

jobs:
# TODO: Shall we use a matrix?

# Test RISC-V targets:

# test-esp32c2:
# name:HIL Test | ESP32-C2
# runs-on:
# labels: [self-hosted, esp32c2]

# steps:
# - name: Run tests on-device
# env:
# PROBE_RS_CHIP: esp32c2
# run: |
# # ...

# test-esp32c3:
# name: HIL Test | ESP32-C3
# runs-on:
# labels: [self-hosted, rustboard]
# env:
# PROBE_RS_CHIP: esp32c3
# CARGO_BUILD_TARGET: riscv32imc-unknown-none-elf

# steps:
# - uses: actions/checkout@v4
# with:
# ref: 'feat/hil-testing'

# - uses: dtolnay/rust-toolchain@v1
# with:
# target: ${{ env.CARGO_BUILD_TARGET }}
# toolchain: nightly

# - name: Run tests
# run: |
# cd hil-test/
# cargo test --release --features=${{ env.PROBE_RS_CHIP }}

test-esp32c6:
name: HIL Test | ESP32-C6
runs-on:
labels: [self-hosted, esp32c6-usb]
env:
PROBE_RS_CHIP: esp32c6
CARGO_BUILD_TARGET: riscv32imac-unknown-none-elf

steps:
- uses: actions/checkout@v4
with:
ref: 'feat/hil-testing'

- uses: dtolnay/rust-toolchain@v1
with:
target: ${{ env.CARGO_BUILD_TARGET }}
toolchain: nightly

- name: Run tests
run: |
cd hil-test/
cargo test --release --features=${{ env.PROBE_RS_CHIP }}
test-esp32h2:
name: HIL Test | ESP32-H2
riscv-hil:
name: HIL Test | ${{ matrix.target.soc }}
runs-on:
labels: [self-hosted, esp32h2-usb]
labels: [self-hosted, "${{ matrix.target.runner }}"]
env:
PROBE_RS_CHIP: esp32h2
CARGO_BUILD_TARGET: riscv32imac-unknown-none-elf

PROBE_RS_CHIP: ${{ matrix.target.soc }}
CARGO_BUILD_TARGET: ${{ matrix.target.rust-target }}
strategy:
fail-fast: false
matrix:
target:
# - soc: esp32c3
# runner: rustboard
# rust-target: riscv32imc-unknown-none-elf
- soc: esp32c6
runner: esp32c6-usb
rust-target: riscv32imac-unknown-none-elf
- soc: esp32h2
runner: esp32h2-usb
rust-target: riscv32imac-unknown-none-elf
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -94,7 +44,7 @@ jobs:
- name: Run tests
run: |
cd hil-test/
cargo test --release --features=${{ env.PROBE_RS_CHIP }}
cargo test --release --features=${{ matrix.target.soc }}
# Test Xtensa targets:
# TODO: Add jobs for Xtensa once supported by `probe-rs`
34 changes: 17 additions & 17 deletions hil-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ We use [probe-rs] for flashing and running the tests on a target device, however
```text
cargo install probe-rs \
--git=https://github.com/probe-rs/probe-rs \
--branch=feature/testing \
--branch=feature/testing-rebased \
--features=cli \
--bin=probe-rs
```
Expand Down Expand Up @@ -60,22 +60,22 @@ Currently, here are the Virtual Machines set up for HIL testing:
- ESP32-C3:
- Has an `ESP32-C3-DevKit-RUST-1` connected via USB-JTAG-SERIAL.
- Pins 2 and 4 are connected for `spi_full_duplex` and `uart` tests.
- VM has the following setup:
```
# Install Rust:
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y --profile minimal
# Source the current shell:
$ source "$HOME/.cargo/env"
# Install dependencies
$ sudo apt install -y pkg-config libudev-dev
# Install probe-rs
$ cargo install probe-rs --git=https://github.com/probe-rs/probe-rs --branch=feature/testing-rebased --features=cli --bin=probe-rs --locked --force
# Add the udev rules
$ wget -O - https://probe.rs/files/69-probe-rs.rules | sudo tee /etc/udev/rules.d/69-probe-rs.rules > /dev/null
# Add the user to plugdev group
$ sudo usermod -a -G plugdev $USER
# Reboot the VM
```
- VM has the following setup:
```
# Install Rust:
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y --profile minimal
# Source the current shell:
$ source "$HOME/.cargo/env"
# Install dependencies
$ sudo apt install -y pkg-config libudev-dev
# Install probe-rs
$ cargo install probe-rs --git=https://github.com/probe-rs/probe-rs --branch=feature/testing-rebased --features=cli --bin=probe-rs --locked --force
# Add the udev rules
$ wget -O - https://probe.rs/files/69-probe-rs.rules | sudo tee /etc/udev/rules.d/69-probe-rs.rules > /dev/null
# Add the user to plugdev group
$ sudo usermod -a -G plugdev $USER
# Reboot the VM
```
- ESP32-C6:
- Has an `ESP32-C6-DevKitC-1 V1.2` connected via USB-JTAG-SERIAL.
- Pins 2 and 4 are connected for `spi_full_duplex` and `uart` tests.
Expand Down

0 comments on commit f713d01

Please sign in to comment.