-
-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Pass J-Link serial and hardware revision as arguments to pytest - Add a setup for different hardware revisions and J-Links to CI/CD - Add support for ARM 64 - Add support for PPK2 - Skip the test when the target J-Link isn´t connected - Device recovering
- Loading branch information
Showing
8 changed files
with
492 additions
and
54 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,5 @@ jobs: | |
uses: ./.github/workflows/build.yml | ||
|
||
test: | ||
needs: [build] | ||
#needs: [build] | ||
uses: ./.github/workflows/test.yml |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,17 @@ on: [workflow_call] | |
|
||
jobs: | ||
test: | ||
runs-on: self-hosted | ||
runs-on: [self-hosted, Linux, ZSWatch] | ||
container: | ||
image: ghcr.io/zephyrproject-rtos/zephyr-build:v0.26.2 | ||
volumes: | ||
- /dev/bus/usb/:/dev/bus/usb | ||
options: --privileged | ||
|
||
strategy: | ||
matrix: | ||
devices: [{hardware_revision: 5, jlink_device: 760208506}, {hardware_revision: 3, jlink_device: 760208490}, {hardware_revision: 3, jlink_device: 760208484}] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
|
@@ -20,32 +24,52 @@ jobs: | |
- name: Install dependencies | ||
continue-on-error: true # JLink install will fail | ||
run: | | ||
if [ ! -f "`which JLinkExe`" ]; then | ||
echo "Installing JLink tools..." | ||
wget -q --post-data 'accept_license_agreement=accepted&non_emb_ctr=confirmed&submit=Download+software' https://www.segger.com/downloads/jlink/JLink_Linux_V796t_x86_64.deb | ||
sudo apt -qq update | ||
sudo apt -y install ./JLink_Linux_V796t_x86_64.deb &>/dev/null | ||
arch=$(arch) | ||
echo "Detected arch: ${arch}" | ||
if [ "${arch}" = "x86_64" ]; then | ||
echo "x64 Architecture" | ||
JLINK_NAME=JLink_Linux_V796t_x86_64 | ||
NRF_NAME=nrf-command-line-tools_10.24.2_amd64 | ||
elif [ "${arch}" = "aarch64" ]; then | ||
echo "ARM 64 Architecture" | ||
JLINK_NAME=JLink_Linux_V796t_arm | ||
NRF_NAME=nrf-command-line-tools_10.24.2_arm64 | ||
sudo dpkg --add-architecture armhf | ||
fi | ||
if [ ! -f "`which nrfjprog`" ]; then | ||
echo "Installing Nordic command line tools..." | ||
wget -q https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/desktop-software/nrf-command-line-tools/sw/versions-10-x-x/10-24-2/nrf-command-line-tools_10.24.2_amd64.deb | ||
sudo apt -y install ./nrf-command-line-tools_10.24.2_amd64.deb &>/dev/null | ||
export PATH=$PATH:/opt | ||
fi | ||
sudo apt-get -qq update | ||
echo "Installing JLink tools..." | ||
wget -q --post-data 'accept_license_agreement=accepted&non_emb_ctr=confirmed&submit=Download+software' https://www.segger.com/downloads/jlink/${JLINK_NAME}.deb | ||
sudo dpkg --unpack ./${JLINK_NAME}.deb | ||
sudo rm /var/lib/dpkg/info/jlink.postinst -f | ||
sudo dpkg --configure jlink | ||
sudo apt install -yf | ||
echo "Installing Nordic command line tools..." | ||
wget -q https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/desktop-software/nrf-command-line-tools/sw/versions-10-x-x/10-24-2/${NRF_NAME}.deb | ||
sudo apt-get -y install ./${NRF_NAME}.deb | ||
python -m pip install --upgrade pip | ||
pip install -r app/pytest/requirements.txt | ||
- name: 'Download image' | ||
nrfjprog -i | ||
- name: Download debug image | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: zswatch_nrf5340_cpuapp@3_debug | ||
|
||
- name: Display structure of downloaded files | ||
run: ls | ||
name: zswatch_nrf5340_cpuapp@${{ matrix.devices.hardware_revision }}_debug | ||
|
||
- name: Test with pytest | ||
continue-on-error: true # Some tests can fail | ||
run: | | ||
pip install pytest | ||
pytest app/pytest/ | ||
pytest --html=report/report.html --jlink=${{ matrix.devices.jlink_device }} --hw=${{ matrix.devices.hardware_revision }} app/pytest/ | ||
- name : Publish results | ||
uses: actions/[email protected] | ||
with: | ||
name: ${{ matrix.devices.jlink_device }}_${{ matrix.devices.hardware_revision }} | ||
path: | | ||
report | ||
if-no-files-found: ignore |
Oops, something went wrong.