Skip to content

QA Integration Test #920

QA Integration Test

QA Integration Test #920

# Copyright (c) 2021-2023 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
if: github.repository_owner == 'tiacsys'
runs-on: [self-hosted, ci-32g-x8, linux, x64, container]
container:
image: ghcr.io/zephyrproject-rtos/ci:v0.26.7
options: '--cpus 4 --memory 8g --entrypoint /bin/bash'
env:
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.16.5
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: Apply container HTTP/2 framing layer workaround
run: |
# FIXME: For unknown reasons, the local development host and CI is
# running in temporary "Error in the HTTP2 framing layer".
# Forcing the historical but still supported HTTP/1.1 layer
# seems to be a stable workaround - happened in Oct. 2023.
git config --global --add http.version HTTP/1.1
- name: Update GitHub PATH for west
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
# It is important that this is run before any caching tasks as cleanups
# are run in reverse order (and you do not want to cleanup before the
# caching is saved).
- name: Clean working directory
uses: FraBle/clean-after-action@v1
#
# Could also be implemented with the new pre- and post-job hook scripts:
#
# - https://stackoverflow.com/questions/70483902
# - https://devopsjournal.io/blog/2023/06/21/GitHub-container-based-Action-cleanup
# - https://docs.github.com/actions/hosting-your-own-runners/running-scripts-before-or-after-a-job
#
with:
keep-git: false
- name: Checkout the code
uses: actions/checkout@v4
with:
fetch-depth: 100
show-progress: true
path: workspace/bridle
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 --local bridle
west update --fetch-opt=--depth=100 --fetch=always --narrow --stats
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 --integration \
--outdir twister-out --no-clean --inline-logs \
--enable-size-report --platform-reports \
--testsuite-root bridle/samples/button \
--testsuite-root bridle/samples/buzzer \
--testsuite-root bridle/samples/helloshell \
--testsuite-root bridle/samples/waveshare_pico_10dof_imu_sensor \
--testsuite-root bridle/samples/waveshare_pico_environment_sensor
- 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 (samples)
report_paths: "**/twister-out/twister.xml"
require_tests: true
fail_on_failure: false
if: always()
qa-shield-integration:
name: Run integration tests for shields
if: github.repository_owner == 'tiacsys'
runs-on: [self-hosted, ci-32g-x8, linux, x64, container]
container:
image: ghcr.io/zephyrproject-rtos/ci:v0.26.7
options: '--cpus 4 --memory 8g --entrypoint /bin/bash'
env:
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.16.5
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: Apply container HTTP/2 framing layer workaround
run: |
# FIXME: For unknown reasons, the local development host and CI is
# running in temporary "Error in the HTTP2 framing layer".
# Forcing the historical but still supported HTTP/1.1 layer
# seems to be a stable workaround - happened in Oct. 2023.
git config --global --add http.version HTTP/1.1
- name: Update GitHub PATH for west
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
# It is important that this is run before any caching tasks as cleanups
# are run in reverse order (and you do not want to cleanup before the
# caching is saved).
- name: Clean working directory
uses: FraBle/clean-after-action@v1
#
# Could also be implemented with the new pre- and post-job hook scripts:
#
# - https://stackoverflow.com/questions/70483902
# - https://devopsjournal.io/blog/2023/06/21/GitHub-container-based-Action-cleanup
# - https://docs.github.com/actions/hosting-your-own-runners/running-scripts-before-or-after-a-job
#
with:
keep-git: false
- name: Checkout the code
uses: actions/checkout@v4
with:
fetch-depth: 100
show-progress: true
path: workspace/bridle
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 --local bridle
west update --fetch-opt=--depth=100 --fetch=always --narrow --stats
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 (up to about 45 min):
#
# --> Grove Button Shields, ~640% more time (~550 more tests)
# --testsuite-root bridle/tests/shields/grove_btn/dts_bindings \
#
# --> Grove LED Shields, ~880% more time (~890 more tests)
# --testsuite-root bridle/tests/shields/grove_led/dts_bindings \
#
west twister --verbose --integration --cmake-only \
--outdir twister-out --no-clean --inline-logs \
--enable-size-report --platform-reports \
--quarantine-list bridle/tests/quarantine.yaml \
--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
if: github.repository_owner == 'tiacsys'
runs-on: [self-hosted, linux, gnuarmemb, zephyr-sdk, tiac_magpie]
strategy:
matrix:
board: [tiac_magpie]
steps:
- name: Apply container HTTP/2 framing layer workaround
run: |
# FIXME: For unknown reasons, the local development host and CI is
# running in temporary "Error in the HTTP2 framing layer".
# Forcing the historical but still supported HTTP/1.1 layer
# seems to be a stable workaround - happened in Oct. 2023.
git config --global --add http.version HTTP/1.1
- name: Update GitHub PATH for west
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
# It is important that this is run before any caching tasks as cleanups
# are run in reverse order (and you do not want to cleanup before the
# caching is saved).
- name: Clean working directory
uses: FraBle/clean-after-action@v1
#
# Could also be implemented with the new pre- and post-job hook scripts:
#
# - https://stackoverflow.com/questions/70483902
# - https://devopsjournal.io/blog/2023/06/21/GitHub-container-based-Action-cleanup
# - https://docs.github.com/actions/hosting-your-own-runners/running-scripts-before-or-after-a-job
#
with:
keep-git: false
- name: Checkout the code
uses: actions/checkout@v4
with:
fetch-depth: 100
show-progress: true
path: workspace/bridle
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 --local bridle
west update --fetch-opt=--depth=100 --fetch=always --narrow --stats
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
#
# TODO: Disabled, as long as required Zephyr SDK version isn't
# available for ARM 64-bit architectures (AArch64).
#
### OFF ### - name: Execute integration tests on target
### OFF ### working-directory: workspace
### OFF ### env:
### OFF ### HARDWARE_MAP: bridle/.github/${{ github.job }}/map-${{ matrix.board }}.yml
### OFF ### run: |
### OFF ### #
### OFF ### # Disabled in the meantime because the execution time is still
### OFF ### # too high and most of the core tests are already performed by
### OFF ### # Zephyr in any case:
### OFF ### #
### OFF ### # --tag arm \
### OFF ### # --tag vector_relay \
### OFF ### # --tag kernel \
### OFF ### #
### OFF ### west twister --verbose --jobs 4 \
### OFF ### --retry-failed 5 --retry-interval 60 \
### OFF ### --outdir twister-out --no-clean --inline-logs \
### OFF ### --enable-size-report --platform-reports \
### OFF ### --device-testing --hardware-map ${HARDWARE_MAP} \
### OFF ### --extra-args SHIELD="loopback_test_tmph" \
### OFF ### --alt-config-root bridle/zephyr/alt-config \
### OFF ### --testsuite-root bridle/tests \
### OFF ### --testsuite-root zephyr/tests \
### OFF ### --tag bridle \
### OFF ### --tag hwinfo \
### OFF ### --tag random \
### OFF ### --tag entropy \
### OFF ### --tag watchdog \
### OFF ### --tag counter \
### OFF ### --tag gpio \
### OFF ### --tag spi \
### OFF ### --tag uart \
### OFF ### --tag can
### OFF ###
### OFF ### - name: Upload integration test results
### OFF ### uses: actions/upload-artifact@v3
### OFF ### with:
### OFF ### name: twister-targets.xml
### OFF ### path: workspace/twister-out/twister.xml
### OFF ###
### OFF ### - name: Convert integration test reports to annotations
### OFF ### uses: mikepenz/action-junit-report@v3
### OFF ### with:
### OFF ### check_name: twister-report (${{ matrix.board }})
### OFF ### report_paths: "**/twister-out/twister.xml"
### OFF ### require_tests: true
### OFF ### fail_on_failure: false
### OFF ### if: always()