Conversation
LCOV of commit
|
There was a problem hiding this comment.
Pull Request Overview
Adds a new GitHub Actions job for running hardware tests on STM32 Nucleo boards and updates the development container to include necessary Python tooling.
- Introduce
hardware-test-stm32-nucleo-l4r5zijob in CI workflow. - Install Python 3, pip, setuptools, and wheel in the devcontainer for hardware test scripts.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .github/workflows/ci.yml | Add hardware-test job that flashes and queries STM32 targets. |
| .devcontainer/Dockerfile | Include python3 and related tooling for test scripts. |
Comments suppressed due to low confidence (1)
.github/workflows/ci.yml:135
- The new hardware-test job appears nested under the previous job's steps due to its indentation. De-indent it to the same level as other jobs under
jobs:so it registers correctly.
hardware-test-stm32-nucleo-l4r5zi:
| name: Hardware test for the STM32 Nucleo L4R5ZI | ||
| # needs: [build-stm32-nucleo-l4r5zi] | ||
| runs-on: stm32l4r5zi | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Run hardware test | ||
| # See https://github.com/OsirisRTOS/hardware-ci for more information | ||
| run: | | ||
| SERIAL_ID="$(board_info serial stm32l4r5zi)" | ||
| echo "Working with chip $SERIAL_ID" | ||
|
|
||
| st-flash --serial "$SERIAL_ID" reset | ||
|
|
||
| board_info print --serial "$SERIAL_ID" --flash-size |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 9 months ago
To fix the issue, we will add a permissions block to the hardware-test-stm32-nucleo-l4r5zi job. Since this job appears to only run hardware tests and does not interact with the repository contents or other GitHub features, the minimal required permission is contents: read. This ensures that the job has only the permissions it needs to function correctly.
| @@ -138,2 +138,4 @@ | ||
| runs-on: stm32l4r5zi | ||
| permissions: | ||
| contents: read | ||
| steps: |
This adds, together with the https://github.com/OsirisRTOS/hardware-ci repo, a way to run hardware tests in CI.
Basically, one sets up the other repo on a server that has one or multiple STM chips attached, and makes them available in CI.
Then you can create a GitHub Action job:
We can run on a specific type of chip via the
runs-onlabel, and get a specific chip serial ID via theboard_info serial stm32l4r5zicommand.board_infoalso supports printing details about a specific chip, like flash size, page size etc.This PR should be merged after #8