diff --git a/.github/workflows/test_nrf52840dk.yml b/.github/workflows/test_nrf52840dk.yml index ce3aaa1d..9fa6f28d 100644 --- a/.github/workflows/test_nrf52840dk.yml +++ b/.github/workflows/test_nrf52840dk.yml @@ -98,12 +98,24 @@ jobs: run: working-directory: connection_tests + container: + image: golioth/golioth-twister-base:8307b9c + env: + ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.16.3 + volumes: + - /dev:/dev + - /home/golioth/credentials:/opt/credentials + options: --privileged + steps: - name: Checkout repo uses: actions/checkout@v3 with: path: connection_tests + - name: Power On USB Hub + run: python3 /opt/golioth-scripts/usb_hub_power.py on + - name: Download build tarball uses: actions/download-artifact@v3 with: @@ -117,15 +129,29 @@ jobs: - name: Copy credentials to samples/test run: | - cp $HOME/credentials_nrf52840dk.yml samples/test/credentials.yml + cp /opt/credentials/credentials_nrf52840dk.yml samples/test/credentials.yml - name: Flash and Verify Test Results + shell: bash run: | cd samples/test - source $HOME/runner_env.sh + source /opt/credentials/runner_env.sh nrfjprog --recover -f NRF52 --snr $CI_NRF52840DK_SNR nrfjprog --program build/zephyr/zephyr.hex --sectoranduicrerase --verify -f NRF52 --snr $CI_NRF52840DK_SNR nrfjprog --pinresetenable -f NRF52 --snr $CI_NRF52840DK_SNR nrfjprog --pinreset -f NRF52 --snr $CI_NRF52840DK_SNR sleep 3 - python verify.py $CI_NRF52840DK_PORT + python3 verify.py $CI_NRF52840DK_PORT + + - name: Erase flash + if: always() + shell: bash + env: + hil_board: ${{ inputs.hil_board }} + run: | + SNR_VAR=CI_${hil_board^^}_SNR + nrfjprog --recover --snr ${!SNR_VAR} + + - name: Power Off USB Hub + if: always() + run: python3 /opt/golioth-scripts/usb_hub_power.py off diff --git a/.github/workflows/test_nrf9160dk.yml b/.github/workflows/test_nrf9160dk.yml index e992d323..f075d596 100644 --- a/.github/workflows/test_nrf9160dk.yml +++ b/.github/workflows/test_nrf9160dk.yml @@ -99,6 +99,15 @@ jobs: needs: build_for_hw_test runs-on: [is_active, has_nrf9160dk] + container: + image: golioth/golioth-twister-base:8307b9c + env: + ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.16.3 + volumes: + - /dev:/dev + - /home/golioth/credentials:/opt/credentials + options: --privileged + defaults: run: working-directory: connection_tests @@ -109,6 +118,9 @@ jobs: with: path: connection_tests + - name: Power On USB Hub + run: python3 /opt/golioth-scripts/usb_hub_power.py on + - name: Download build tarball uses: actions/download-artifact@v3 with: @@ -122,16 +134,30 @@ jobs: - name: Copy credentials to samples/test run: | - cp $HOME/credentials_nrf9160dk.yml samples/test/credentials.yml + cp /opt/credentials/credentials_nrf9160dk.yml samples/test/credentials.yml - name: Flash and Verify Test Results + shell: bash run: | cd samples/test - source $HOME/runner_env.sh + source /opt/credentials/runner_env.sh nrfjprog --recover -f NRF91 --snr $CI_NRF9160DK_SNR nrfjprog --eraseall -f NRF91 --snr $CI_NRF9160DK_SNR nrfjprog --program build/zephyr/merged.hex --verify -f NRF91 --snr $CI_NRF9160DK_SNR nrfjprog --pinreset -f NRF91 --snr $CI_NRF9160DK_SNR sleep 3 # Add a longer timeout to verify step for LTE connection - python verify.py $CI_NRF9160DK_PORT --timeout 300 + python3 verify.py $CI_NRF9160DK_PORT --timeout 300 + + - name: Erase flash + if: always() + shell: bash + env: + hil_board: ${{ inputs.hil_board }} + run: | + SNR_VAR=CI_${hil_board^^}_SNR + nrfjprog --recover --snr ${!SNR_VAR} + + - name: Power Off USB Hub + if: always() + run: python3 /opt/golioth-scripts/usb_hub_power.py off