2023-08-08 17:44:07 +08:00
|
|
|
# Copyright (c) 2023 Intel Corporation.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
name: Twister BlackBox TestSuite
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
2024-03-05 01:39:37 +08:00
|
|
|
- collab-*
|
|
|
|
- v*-branch
|
2023-08-08 17:44:07 +08:00
|
|
|
paths:
|
|
|
|
- 'scripts/pylib/twister/**'
|
|
|
|
- 'scripts/twister'
|
|
|
|
- 'scripts/tests/twister_blackbox/**'
|
2023-09-19 07:43:16 +08:00
|
|
|
- '.github/workflows/twister_tests_blackbox.yml'
|
2023-08-08 17:44:07 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
twister-tests:
|
|
|
|
name: Twister Black Box Tests
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-10-11 18:03:29 +08:00
|
|
|
python-version: ['3.10', '3.11', '3.12', '3.13']
|
2023-08-08 17:44:07 +08:00
|
|
|
os: [ubuntu-22.04]
|
|
|
|
container:
|
2024-10-26 17:51:01 +08:00
|
|
|
image: ghcr.io/zephyrproject-rtos/ci:v0.27.4
|
2023-08-08 17:44:07 +08:00
|
|
|
|
|
|
|
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: Checkout
|
2024-01-27 12:26:39 +08:00
|
|
|
uses: actions/checkout@v4
|
2023-08-08 17:44:07 +08:00
|
|
|
|
2023-09-11 21:02:17 +08:00
|
|
|
- name: Environment Setup
|
|
|
|
run: |
|
|
|
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
|
|
|
|
|
|
west init -l . || true
|
2024-08-06 02:00:55 +08:00
|
|
|
# we do not depend on any hals, tools or bootloader, save some time and space...
|
|
|
|
west config manifest.group-filter -- -hal,-tools,-bootloader
|
2023-09-11 21:02:17 +08:00
|
|
|
west config --global update.narrow true
|
|
|
|
west update --path-cache /github/cache/zephyrproject 2>&1 1> west.update.log || west update --path-cache /github/cache/zephyrproject 2>&1 1> west.update.log || ( rm -rf ../modules ../bootloader ../tools && west update --path-cache /github/cache/zephyrproject)
|
|
|
|
west forall -c 'git reset --hard HEAD'
|
|
|
|
|
2024-01-16 02:29:46 +08:00
|
|
|
echo "ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-$( cat SDK_VERSION )" >> $GITHUB_ENV
|
|
|
|
|
2023-08-08 17:44:07 +08:00
|
|
|
- name: Set Up Python ${{ matrix.python-version }}
|
2024-03-05 19:57:57 +08:00
|
|
|
uses: actions/setup-python@v5
|
2023-08-08 17:44:07 +08:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
|
|
|
|
- name: Go Into Venv
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
python3 -m pip install --user virtualenv
|
|
|
|
python3 -m venv env
|
|
|
|
source env/bin/activate
|
|
|
|
echo "$(which python)"
|
|
|
|
|
|
|
|
- name: Install Packages
|
|
|
|
run: |
|
|
|
|
python3 -m pip install -U -r scripts/requirements-base.txt -r scripts/requirements-build-test.txt -r scripts/requirements-run-test.txt
|
|
|
|
|
|
|
|
- name: Run Pytest For Twister Black Box Tests
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
ZEPHYR_BASE: ./
|
|
|
|
ZEPHYR_TOOLCHAIN_VARIANT: zephyr
|
|
|
|
run: |
|
|
|
|
echo "Run twister tests"
|
|
|
|
source zephyr-env.sh
|
|
|
|
PYTHONPATH="./scripts/tests" pytest ./scripts/tests/twister_blackbox
|