Skip to content

Commit 2a10958

Browse files
committed
ci: twister/blackbox: pin pip modules
Rework workflow to use pinned python packages and zephyr setup action. Signed-off-by: Anas Nashif <[email protected]>
1 parent 16a3135 commit 2a10958

File tree

1 file changed

+24
-37
lines changed

1 file changed

+24
-37
lines changed

.github/workflows/twister_tests_blackbox.yml

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,65 +15,52 @@ on:
1515
- 'scripts/tests/twister_blackbox/**'
1616
- '.github/workflows/twister_tests_blackbox.yml'
1717

18+
permissions:
19+
contents: read
20+
1821
jobs:
1922
twister-tests:
2023
name: Twister Black Box Tests
21-
runs-on: ${{ matrix.os }}
24+
runs-on: ubuntu-24.04
2225
strategy:
2326
matrix:
24-
python-version: ['3.10', '3.11', '3.12']
25-
os: [ubuntu-22.04]
26-
container:
27-
image: ghcr.io/zephyrproject-rtos/ci:v0.26.18
28-
27+
python-version: ['3.10', '3.11', '3.12', '3.13']
2928
steps:
30-
- name: Apply Container Owner Mismatch Workaround
31-
run: |
32-
# FIXME: The owner UID of the GITHUB_WORKSPACE directory may not
33-
# match the container user UID because of the way GitHub
34-
# Actions runner is implemented. Remove this workaround when
35-
# GitHub comes up with a fundamental fix for this problem.
36-
git config --global --add safe.directory ${GITHUB_WORKSPACE}
37-
3829
- name: Checkout
3930
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
40-
41-
- name: Environment Setup
42-
run: |
43-
echo "$HOME/.local/bin" >> $GITHUB_PATH
44-
45-
west init -l . || true
46-
west config manifest.group-filter -- -hal,-tools,-bootloader,-babblesim
47-
west config manifest.project-filter -- -nrf_hw_models
48-
west config --global update.narrow true
49-
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)
50-
west forall -c 'git reset --hard HEAD'
51-
52-
echo "ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-$( cat SDK_VERSION )" >> $GITHUB_ENV
31+
with:
32+
path: zephyr
33+
fetch-depth: 0
5334

5435
- name: Set Up Python ${{ matrix.python-version }}
5536
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
5637
with:
5738
python-version: ${{ matrix.python-version }}
39+
cache: pip
40+
cache-dependency-path: scripts/requirements-actions.txt
5841

59-
- name: Go Into Venv
60-
shell: bash
42+
- name: install-packages
43+
working-directory: zephyr
6144
run: |
62-
python3 -m pip install --user virtualenv
63-
python3 -m venv env
64-
source env/bin/activate
65-
echo "$(which python)"
45+
pip install -r scripts/requirements-actions.txt --require-hashes
46+
sudo apt-get update -y
47+
sudo apt-get install -y lcov
6648
67-
- name: Install Packages
68-
run: |
69-
python3 -m pip install -U -r scripts/requirements-base.txt -r scripts/requirements-build-test.txt -r scripts/requirements-run-test.txt
49+
- name: Setup Zephyr project
50+
uses: zephyrproject-rtos/action-zephyr-setup@f7b70269a8eb01f70c8e710891e4c94972a2f6b4 # v1.0.6
51+
with:
52+
app-path: zephyr
53+
sdk-version: 0.16.9
54+
toolchains: all
7055

7156
- name: Run Pytest For Twister Black Box Tests
57+
working-directory: zephyr
7258
shell: bash
7359
env:
7460
ZEPHYR_BASE: ./
7561
ZEPHYR_TOOLCHAIN_VARIANT: zephyr
7662
run: |
63+
export ZEPHYR_SDK_INSTALL_DIR=${{ github.workspace }}/zephyr-sdk
7764
echo "Run twister tests"
7865
source zephyr-env.sh
79-
PYTHONPATH="./scripts/tests" pytest ./scripts/tests/twister_blackbox
66+
PYTHONPATH="./scripts/tests" pytest ./scripts/tests/twister_blackbox/

0 commit comments

Comments
 (0)