Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
55022eb50This file is pinned to the selected release. Download the original to open it in your design tool.
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 TiaC Systems
# SPDX-FileCopyrightText: Copyright (c) 2021 Li-Pro.Net
# SPDX-License-Identifier: Apache-2.0
name: QA Integration Test
on:
workflow_dispatch: # And manually on button click
workflow_run:
workflows: ["QA Acceptance Test"]
types: [completed]
branches: [main]
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, for-zephyr-qa]
container:
image: ghcr.io/zephyrproject-rtos/ci:v0.29.3
options: '--cpus 4 --memory 8g --entrypoint /bin/bash'
env:
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-1.0.1
defaults:
run:
shell: bash
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: tiacsys/clean-after-action@v4
#
# 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@v7
with:
fetch-depth: 100
show-progress: true
path: workspace/bridle
ref: ${{ github.ref }}
- name: Install uv
uses: astral-sh/setup-uv@v10.0.1
with:
working-directory: workspace
enable-cache: true
- name: Create and enter Python 3.12 virtual environment
working-directory: workspace
run: |
uv venv --python 3.12 --clear .venv
source .venv/bin/activate
echo "$PATH" > $GITHUB_PATH
- name: Setup Zephyr SDK
run: |
"${ZEPHYR_SDK_INSTALL_DIR}/setup.sh" -t all -l -h -c
- name: Install base dependencies
working-directory: workspace
run: |
which python3 && python3 --version
which uv && uv --version
uv pip install --upgrade --requirement bridle/zephyr/requirements-base.txt
uv pip show --files west
which west && west --version
- 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: |
# uv pip install --upgrade --requirement zephyr/scripts/requirements-base.txt
# uv pip install --upgrade --requirement zephyr/scripts/requirements-build-test.txt
# uv pip install --upgrade --requirement zephyr/scripts/requirements-run-test.txt
# uv pip install --upgrade --requirement zephyr/scripts/requirements-extras.txt
# uv pip install --upgrade --requirement zephyr/scripts/requirements-compliance.txt
# uv pip install --upgrade --requirement bridle/zephyr/requirements-build.txt
west packages pip | xargs uv pip install --upgrade
- name: Fetch binary blobs
working-directory: workspace
env:
BLOBS_FETCH_NOT_FAIL: false
BLOBS_MODULES_LST_FILE: bridle/.github/${{ github.job }}/blobs-modules.txt
BLOBS_MODULES_SED_ARGS: -e '/^\s*$/ d' -e '/^#/ d' -e 's/\s*#.*$//'
run: |
if [[ -s "${BLOBS_MODULES_LST_FILE}" ]]; then
BLOBS_MODULES=$(echo $(eval sed "${BLOBS_MODULES_SED_ARGS}" "${BLOBS_MODULES_LST_FILE}"))
if [[ -n "${BLOBS_MODULES}" ]]; then
retry_thrice() { (echo "1st: '$@'" ; $@) || (echo "2nd: '$@'" ; $@) || (echo "3rd: '$@'" ; $@) ; }
retry_thrice west blobs --auto-accept fetch "${BLOBS_MODULES}" || ${BLOBS_FETCH_NOT_FAIL}
fi
fi
- name: Build samples
working-directory: workspace
run: |
west twister --verbose --jobs 4 \
--retry-failed 5 --retry-interval 60 \
--outdir twister-out --no-clean --inline-logs \
--quarantine-list bridle/tests/quarantine.yaml \
--alt-config-root bridle/zephyr/alt-config/samples \
--integration --no-detailed-test-id \
--testsuite-root bridle/samples \
--testsuite-root zephyr/samples \
--tag bridle \
--tag zephyr
- name: Upload integration test logging
uses: actions/upload-artifact@v7
with:
name: twister-samples.log
path: workspace/twister-out/twister.log
- name: Upload integration test results
uses: actions/upload-artifact@v7
with:
name: twister-samples.xml
path: workspace/twister-out/twister.xml
# - name: Convert integration test reports to annotations
# if: always()
# uses: mikepenz/action-junit-report@v6
# with:
# check_name: twister-report (samples)
# report_paths: "**/twister-out/twister.xml"
# require_tests: true
# fail_on_failure: false
qa-tests-integration:
name: Run integration tests from upstream
if: ${{ github.repository_owner == 'tiacsys' }}
runs-on: [self-hosted, ci-32g-x8, linux, x64, container, for-zephyr-qa]
container:
image: ghcr.io/zephyrproject-rtos/ci:v0.29.3
options: '--cpus 4 --memory 8g --entrypoint /bin/bash'
env:
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-1.0.1
defaults:
run:
shell: bash
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: tiacsys/clean-after-action@v4
#
# 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@v7
with:
fetch-depth: 100
show-progress: true
path: workspace/bridle
ref: ${{ github.ref }}
- name: Install uv
uses: astral-sh/setup-uv@v10.0.1
with:
working-directory: workspace
enable-cache: true
- name: Create and enter Python 3.12 virtual environment
working-directory: workspace
run: |
uv venv --python 3.12 --clear .venv
source .venv/bin/activate
echo "$PATH" > $GITHUB_PATH
- name: Setup Zephyr SDK
run: |
"${ZEPHYR_SDK_INSTALL_DIR}/setup.sh" -t all -l -h -c
- name: Install base dependencies
working-directory: workspace
run: |
which python3 && python3 --version
which uv && uv --version
uv pip install --upgrade --requirement bridle/zephyr/requirements-base.txt
uv pip show --files west
which west && west --version
- 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: |
# uv pip install --upgrade --requirement zephyr/scripts/requirements-base.txt
# uv pip install --upgrade --requirement zephyr/scripts/requirements-build-test.txt
# uv pip install --upgrade --requirement zephyr/scripts/requirements-run-test.txt
# uv pip install --upgrade --requirement zephyr/scripts/requirements-extras.txt
# uv pip install --upgrade --requirement zephyr/scripts/requirements-compliance.txt
# uv pip install --upgrade --requirement bridle/zephyr/requirements-build.txt
west packages pip | xargs uv pip install --upgrade
- name: Build tests
working-directory: workspace
run: |
west twister --verbose --jobs 4 \
--retry-failed 5 --retry-interval 60 \
--outdir twister-out --no-clean --inline-logs \
--alt-config-root bridle/zephyr/alt-config/tests \
--integration --no-detailed-test-id \
--testsuite-root bridle/tests \
--testsuite-root zephyr/tests \
--tag sc18is604 \
--tag bridle \
--tag zephyr
- name: Upload integration test logging
uses: actions/upload-artifact@v7
with:
name: twister-tests.log
path: workspace/twister-out/twister.log
- name: Upload integration test results
uses: actions/upload-artifact@v7
with:
name: twister-tests.xml
path: workspace/twister-out/twister.xml
# - name: Convert integration test reports to annotations
# if: always()
# uses: mikepenz/action-junit-report@v6
# with:
# check_name: twister-report (tests)
# report_paths: "**/twister-out/twister.xml"
# require_tests: true
# fail_on_failure: false