Add labgrid-driven hardware CI (adi-lg-matlab)#201
Merged
Conversation
Lets labgrid (adi-labgrid-plugins) provision a board — power it, boot the FPGA/SoC, and hand MATLAB the booted board's libIIO URI — so the existing runHWTests run against it, locally and in GitHub Actions. runHWTests already honours IIO_URI, so no MATLAB source change is needed; the adi-lg-matlab launcher sets IIO_URI/board, runs the tests, and copies the JUnit output. - test/hw_ci/board_map.yaml: map labgrid place tags (carrier / daughter-board / hdl-config) to the MATLAB board reference names in runHWTests.m's switch. Keep in sync with that switch. - .github/workflows/hw-matlab.yml: bespoke workflow — a discover job on a coordinator-adjacent runner builds the matrix; per-place shards on hw-<place> self-hosted runners (MATLAB + libiio) acquire the place, run adi-lg-matlab, release on always(), and upload JUnit. - README: local + CI usage.
Address CodeQL 'Workflow does not contain permissions' findings: add a minimal top-level 'contents: read' default and widen only the publish job (checks: write, pull-requests: write) for the test-result action.
The publish job ran on [self-hosted, hw-coordinator] with if: always(), so on PRs without the hw-test label (where discover/hw are skipped) it sat pending forever waiting for a HW runner. Gate it on the hw job not being skipped so it is skipped cleanly on those PRs.
The windows-2019 hosted runner image was retired (EOL mid-2025), so the Build libad9361-iio for Windows job queued forever with no runner. Move it to windows-2022 and bump the setup-msbuild vs-version to the VS 2022 range. The prebuilt libiio v0.25 (VS2019) links fine into a VS2022 build (MSVC v142/v143 are ABI-compatible).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Lets labgrid (adi-labgrid-plugins) provision a board — power it, boot the FPGA/SoC, and hand MATLAB the booted board's libIIO URI — so the existing
runHWTestsrun against it, both locally and in GitHub Actions.runHWTestsalready honoursIIO_URI, so no MATLAB source change is needed: theadi-lg-matlablauncher boots the board, setsIIO_URI/board, runs the tests, and copies the JUnit output.Contents
test/hw_ci/board_map.yaml— maps labgrid place tags (carrier/daughter-board/hdl-config) to the MATLAB board reference names inrunHWTests.m'sswitch. Keep in sync with that switch..github/workflows/hw-matlab.yml— bespoke workflow: adiscoverjob on a coordinator-adjacent runner builds the matrix; per-place shards onhw-<place>self-hosted runners (MATLAB + libiio) acquire the place, runadi-lg-matlab, release onalways(), and upload JUnit.Prerequisites / notes
adi-lg-matlablauncher in adi-labgrid-plugins (Add adi-lg-matlab: labgrid HW launcher for MATLAB toolboxes tfcollins/labgrid-plugins#31). The workflow pins@v2, so that change must land on thev2ref first.daughter-board/carriervalues inboard_map.yamlmust match the tags the lab admin sets on each coordinator place — adjust to your lab's convention.hw-<place>runners must have MATLAB (R2025b on nemo) + a batch license + libiio. The workflow'sMATLAB_BINdefaults to/opt/MATLAB/R2025b/bin/matlab.