Skip to content

Commit eeb142d

Browse files
LukaszMrugalajhedberg
authored andcommitted
.github: workflows: Workflow for build_helpers
PR zephyrproject-rtos#63195 has managed to change code under test without triggering those tests. This change should remedy that by creating a new workflow, based on twister_tests.yaml, that runs tests in scripts/tests/build_helpers if build_helpers are modified. Such a workflow should be easily extendable if we ever have more non-Twister things to test in scripts/pylib. Signed-off-by: Lukasz Mrugala <[email protected]>
1 parent 76f9a02 commit eeb142d

File tree

2 files changed

+55
-1
lines changed

2 files changed

+55
-1
lines changed

.github/workflows/pylib_tests.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Copyright (c) 2023 Intel Corporation.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Misc. Pylib Scripts TestSuite
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
- v*-branch
11+
paths:
12+
- 'scripts/pylib/build_helpers/**'
13+
- '.github/workflows/pylib_tests.yml'
14+
pull_request:
15+
branches:
16+
- main
17+
- v*-branch
18+
paths:
19+
- 'scripts/pylib/build_helpers/**'
20+
- '.github/workflows/pylib_tests.yml'
21+
22+
jobs:
23+
pylib-tests:
24+
name: Misc. Pylib Unit Tests
25+
runs-on: ${{ matrix.os }}
26+
strategy:
27+
matrix:
28+
python-version: [3.8, 3.9, '3.10']
29+
os: [ubuntu-22.04]
30+
steps:
31+
- name: checkout
32+
uses: actions/checkout@v3
33+
- name: Set up Python ${{ matrix.python-version }}
34+
uses: actions/setup-python@v4
35+
with:
36+
python-version: ${{ matrix.python-version }}
37+
- name: cache-pip-linux
38+
if: startsWith(runner.os, 'Linux')
39+
uses: actions/cache@v3
40+
with:
41+
path: ~/.cache/pip
42+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
43+
restore-keys: |
44+
${{ runner.os }}-pip-${{ matrix.python-version }}
45+
- name: install-packages
46+
run: |
47+
pip3 install -r scripts/requirements-base.txt -r scripts/requirements-build-test.txt
48+
- name: Run pytest for build_helpers
49+
env:
50+
ZEPHYR_BASE: ./
51+
ZEPHYR_TOOLCHAIN_VARIANT: zephyr
52+
run: |
53+
echo "Run build_helpers tests"
54+
PYTHONPATH=./scripts/tests pytest ./scripts/tests/build_helpers

scripts/tests/twister/test_domains.py scripts/tests/build_helpers/test_domains.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import sys
1313

1414
ZEPHYR_BASE = os.getenv("ZEPHYR_BASE")
15-
sys.path.insert(0, os.path.join(ZEPHYR_BASE, "scripts/pylib/twister"))
15+
sys.path.insert(0, os.path.join(ZEPHYR_BASE, "scripts/pylib/build_helpers"))
1616

1717
import domains
1818

0 commit comments

Comments
 (0)