Skip to content

Commit

Permalink
Pre-build xtask binary
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Aug 14, 2024
1 parent f22e0fb commit d7d1957
Showing 1 changed file with 54 additions and 12 deletions.
66 changes: 54 additions & 12 deletions .github/workflows/hil.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,46 @@ env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
build-xtasks:
name: Build xtasks | ${{ matrix.host.arch }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
host:
- arch: armv7
rust-target: armv7-unknown-linux-gnueabihf
- arch: aarch64
rust-target: aarch64-unknown-linux-gnu

steps:
- uses: actions/checkout@v4
if: github.event_name != 'workflow_dispatch'
- uses: actions/checkout@v4
if: github.event_name == 'workflow_dispatch'
with:
repository: ${{ github.event.inputs.repository }}
ref: ${{ github.event.inputs.branch }}

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
components: rust-src

- name: Install cross
run: cargo install cross

- name: Build xtasks
run: cross build --release --target ${{ matrix.host.rust-target }}

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: xtasks-${{ matrix.host.arch }}
path: target/${{ matrix.host.rust-target }}/release/xtasks

build-tests:
name: Build HIL Tests | ${{ matrix.target.soc }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -93,7 +133,7 @@ jobs:

hil:
name: Run HIL Tests | ${{ matrix.target.soc }}
needs: build-tests
needs: [build-tests, build-xtasks]
runs-on:
labels: [self-hosted, "${{ matrix.target.runner }}"]
strategy:
Expand All @@ -104,40 +144,42 @@ jobs:
- soc: esp32c2
runner: esp32c2-jtag
usb: USB2
host: aarch64
- soc: esp32c3
runner: esp32c3-usb
usb: ACM0
host: armv7
- soc: esp32c6
runner: esp32c6-usb
usb: ACM0
host: armv7
- soc: esp32h2
runner: esp32h2-usb
usb: USB0
host: armv7
# Xtensa devices:
- soc: esp32s2
runner: esp32s2-jtag
usb: USB1
host: armv7
- soc: esp32s3
runner: esp32s3-usb
usb: USB0
host: armv7
steps:
- uses: actions/checkout@v4
if: github.event_name != 'workflow_dispatch'
- uses: actions/checkout@v4
if: github.event_name == 'workflow_dispatch'
with:
repository: ${{ github.event.inputs.repository }}
ref: ${{ github.event.inputs.branch }}

- uses: actions/download-artifact@v4
with:
name: tests-${{ matrix.target.soc }}
path: tests-${{ matrix.target.soc }}

- uses: actions/download-artifact@v4
with:
name: xtasks-${{ matrix.target.host }}
path: xtask

- name: Run Tests
id: run-tests
run: |
export PATH=$PATH:/home/espressif/.cargo/bin
cargo xtask run-elfs ${{ matrix.target.soc }} tests-${{ matrix.target.soc }}
run: ./xtask run-elfs ${{ matrix.target.soc }} tests-${{ matrix.target.soc }}

- name: Erase Flash on Failure
if: ${{ failure() && steps.run-tests.conclusion == 'failure' }}
Expand Down

0 comments on commit d7d1957

Please sign in to comment.