Skip to content

ci: github: qa: split jobs into shields and samples #717

ci: github: qa: split jobs into shields and samples

ci: github: qa: split jobs into shields and samples #717

# Copyright (c) 2021-2022 TiaC Systems
# Copyright (c) 2021 Li-Pro.Net
# SPDX-License-Identifier: Apache-2.0
name: QA Integration Test
on:
schedule:
- cron: "0 2 * * *" # run at 2 AM UTC
workflow_dispatch: # And manually on button click
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'applications/**'
- 'arch/**'
- 'boards/**'
- 'cmake/**'
- 'drivers/**'
- 'dts/**'
- 'include/**'
- 'lib/**'
- 'modules/**'
- 'samples/**'
- 'tests/**'
- 'soc/**'
- 'subsys/**'
- '**/CMakeLists.txt'
- '**/Kconfig*'
- '**.conf'
- '**.defconfig'
- '**.overlay'
- '**.yaml'
- 'scripts/requirements-*'
- 'scripts/requirements.txt'
- 'west.yml'
- '.github/workflows/qa-integration.yml'
jobs:
qa-samples-integration:
name: Run integration tests for samples
runs-on: ubuntu-latest
container:
image: ghcr.io/zephyrproject-rtos/ci:v0.26.4
options: '--entrypoint /bin/bash'
env:
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.16.1
steps:
- name: Apply container owner mismatch workaround
run: |
# FIXME: The owner UID of the GITHUB_WORKSPACE directory may not
# match the container user UID because of the way GitHub
# Actions runner is implemented. Remove this workaround when
# GitHub comes up with a fundamental fix for this problem.
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Update GitHub PATH for west
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Checkout the code
uses: actions/checkout@v3
with:
path: workspace/bridle
submodules: recursive
ref: ${{ github.ref }}
- name: Restore PIP Cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-qa-pip
- name: Install base dependencies
working-directory: workspace
run: |
pip3 install --upgrade pip
pip3 install --upgrade setuptools
pip3 install --upgrade --requirement bridle/scripts/requirements-base.txt
- name: West init and update
working-directory: workspace
run: |
west init -l bridle
west update
west zephyr-export
west bridle-export
- name: Install build and test dependencies
working-directory: workspace
run: |
pip3 install --upgrade --requirement zephyr/scripts/requirements-base.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-build-test.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-run-test.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-extras.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-compliance.txt
pip3 install --upgrade --requirement bridle/scripts/requirements-build.txt
- name: Build samples
working-directory: workspace
run: |
west twister --verbose --jobs 4 --integration \
--outdir twister-out --no-clean --inline-logs \
--enable-size-report --platform-reports \
--testsuite-root bridle/samples/button \
--testsuite-root bridle/samples/helloshell
- name: Upload integration test results
uses: actions/upload-artifact@v3
with:
name: twister-samples.xml
path: workspace/twister-out/twister.xml
- name: Convert integration test reports to annotations
uses: mikepenz/action-junit-report@v3
with:
check_name: twister-report (shields)
report_paths: "**/twister-out/twister.xml"
require_tests: true
fail_on_failure: false
if: always()
qa-shield-integration:
name: Run integration tests for shields
runs-on: ubuntu-latest
container:
image: ghcr.io/zephyrproject-rtos/ci:v0.26.4
options: '--entrypoint /bin/bash'
env:
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.16.1
steps:
- name: Apply container owner mismatch workaround
run: |
# FIXME: The owner UID of the GITHUB_WORKSPACE directory may not
# match the container user UID because of the way GitHub
# Actions runner is implemented. Remove this workaround when
# GitHub comes up with a fundamental fix for this problem.
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Update GitHub PATH for west
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Checkout the code
uses: actions/checkout@v3
with:
path: workspace/bridle
submodules: recursive
ref: ${{ github.ref }}
- name: Restore PIP Cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-qa-pip
- name: Install base dependencies
working-directory: workspace
run: |
pip3 install --upgrade pip
pip3 install --upgrade setuptools
pip3 install --upgrade --requirement bridle/scripts/requirements-base.txt
- name: West init and update
working-directory: workspace
run: |
west init -l bridle
west update
west zephyr-export
west bridle-export
- name: Install build and test dependencies
working-directory: workspace
run: |
pip3 install --upgrade --requirement zephyr/scripts/requirements-base.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-build-test.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-run-test.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-extras.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-compliance.txt
pip3 install --upgrade --requirement bridle/scripts/requirements-build.txt
- name: Build integration tests for shields
working-directory: workspace
run: |
#
# Disabled in the meantime because the execution time is still
# too high:
#
# --testsuite-root bridle/tests/shields/grove_btn/dts_bindings \
# --testsuite-root bridle/tests/shields/grove_led/dts_bindings \
#
west twister --verbose --jobs 4 \
--outdir twister-out --no-clean --inline-logs \
--enable-size-report --platform-reports \
--platform arduino_zero \
--platform mimxrt1010_evk \
--platform mimxrt1060_evk \
--platform mimxrt1060_evkb \
--platform nucleo_f303re \
--platform nucleo_f401re \
--platform nucleo_f413zh \
--platform nucleo_f767zi \
--platform rpi_pico \
--platform seeed_xiao_samd21 \
--platform seeeduino_xiao \
--platform seeeduino_lotus \
--platform waveshare_rp2040_plus \
--platform waveshare_rp2040_plus@16mb \
--testsuite-root bridle/tests/shields/grove/dts_bindings \
--testsuite-root bridle/tests/shields/x_grove_testbed/dts_bindings
- name: Upload integration test results
uses: actions/upload-artifact@v3
with:
name: twister-shields.xml
path: workspace/twister-out/twister.xml
- name: Convert integration test reports to annotations
uses: mikepenz/action-junit-report@v3
with:
check_name: twister-report (shields)
report_paths: "**/twister-out/twister.xml"
require_tests: true
fail_on_failure: false
if: always()
qa-target-integration:
name: Run integration tests on targets
runs-on: [self-hosted, linux, gnuarmemb, zephyr-sdk, tiac_magpie]
strategy:
matrix:
board: [tiac_magpie]
steps:
- name: Update GitHub PATH for west
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Clean working directory
run: |
rm -rf "${{ github.workspace }}/workspace"
- name: Checkout the code
uses: actions/checkout@v3
with:
path: workspace/bridle
submodules: recursive
ref: ${{ github.ref }}
- name: Install base dependencies
working-directory: workspace
run: |
pip3 install --upgrade pip
pip3 install --upgrade setuptools
pip3 install --upgrade --requirement bridle/scripts/requirements-base.txt
- name: West init and update
working-directory: workspace
run: |
west init -l bridle
west update
west zephyr-export
west bridle-export
- name: Install build and test dependencies
working-directory: workspace
run: |
pip3 install --upgrade --requirement zephyr/scripts/requirements-base.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-build-test.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-run-test.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-extras.txt
pip3 install --upgrade --requirement zephyr/scripts/requirements-compliance.txt
pip3 install --upgrade --requirement bridle/scripts/requirements-build.txt
- name: Execute integration tests on target
working-directory: workspace
env:
HARDWARE_MAP: bridle/.github/${{ github.job }}/map-${{ matrix.board }}.yml
run: |
#
# Disabled in the meantime because the execution time is still
# too high and most of the core tests are already performed by
# Zephyr in any case:
#
# --tag arm \
# --tag vector_relay \
# --tag kernel \
#
west twister --verbose --jobs 4 \
--retry-failed 5 --retry-interval 120 \
--outdir twister-out --no-clean --inline-logs \
--enable-size-report --platform-reports \
--device-testing --hardware-map ${HARDWARE_MAP} \
--extra-args SHIELD="loopback_test_tmph" \
--alt-config-root bridle/zephyr/alt-config \
--testsuite-root bridle/tests \
--testsuite-root zephyr/tests \
--tag bridle \
--tag hwinfo \
--tag random \
--tag entropy \
--tag watchdog \
--tag counter \
--tag gpio \
--tag spi \
--tag uart \
--tag can
- name: Upload integration test results
uses: actions/upload-artifact@v3
with:
name: twister-targets.xml
path: workspace/twister-out/twister.xml
- name: Convert integration test reports to annotations
uses: mikepenz/action-junit-report@v3
with:
check_name: twister-report (${{ matrix.board }})
report_paths: "**/twister-out/twister.xml"
require_tests: true
fail_on_failure: false
if: always()