Skip to content

Commit 597d42f

Browse files
committed
ci: Force Python 3.10 for testing
Python 3.10 is currently the minimum Python version supported by Zephyr and the version intended to be used with Zephyr SDK (note that `gdb-py` links against `libpython3.10`), so test with Python 3.10 on all host operating sytems. As part of this, virtual environment usage is forced on Linux hosts in order to ensure that the correct version and installation of Python is used. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent c318ccf commit 597d42f

File tree

1 file changed

+8
-20
lines changed

1 file changed

+8
-20
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,11 +1429,10 @@ jobs:
14291429

14301430
steps:
14311431
- name: Set up Python
1432-
if: ${{ runner.os == 'Windows' }}
14331432
uses: actions/setup-python@v5
14341433
with:
1435-
# Force Python 3.10 because the twister is not compatible with a Python
1436-
# version lower than 3.8 on Windows.
1434+
# Force Python 3.10, which is the minimum Python version supported by
1435+
# Zephyr and intended to be used with Zephyr SDK.
14371436
python-version: '3.10'
14381437

14391438
- name: Set up test environment (Linux)
@@ -1467,7 +1466,6 @@ jobs:
14671466
echo "ARTIFACT_ROOT=${GITHUB_WORKSPACE}/artifacts" >> $GITHUB_ENV
14681467
14691468
- name: Create Python virtual environment
1470-
if: ${{ runner.os != 'Linux' }}
14711469
run: |
14721470
# Create Python virtual environment
14731471
python3 -m venv ${GITHUB_WORKSPACE}/venv
@@ -1568,19 +1566,15 @@ jobs:
15681566
- name: Install west
15691567
run: |
15701568
# Activate Python virtual environment
1571-
if [ ! -z "${VENV_ACTIVATE}" ]; then
1572-
source ${VENV_ACTIVATE}
1573-
fi
1569+
source ${VENV_ACTIVATE}
15741570
15751571
# Install or upgrade west
15761572
pip3 install --upgrade west
15771573
15781574
- name: Set up Zephyr repository
15791575
run: |
15801576
# Activate Python virtual environment
1581-
if [ ! -z "${VENV_ACTIVATE}" ]; then
1582-
source ${VENV_ACTIVATE}
1583-
fi
1577+
source ${VENV_ACTIVATE}
15841578
15851579
# Create Zephyr workspace
15861580
ZEPHYR_WORKSPACE=${GITHUB_WORKSPACE}/zephyrproject
@@ -1610,21 +1604,15 @@ jobs:
16101604
- name: Install Python dependencies
16111605
run: |
16121606
# Activate Python virtual environment
1613-
if [ ! -z "${VENV_ACTIVATE}" ]; then
1614-
source ${VENV_ACTIVATE}
1607+
source ${VENV_ACTIVATE}
16151608
1616-
# Install Python dependencies from the checked out Zephyr repository
1617-
# if running inside a virtual environment; otherwise, it is assumed
1618-
# that the host already provides all the required dependencies.
1619-
pip3 install -r ${ZEPHYR_ROOT}/scripts/requirements.txt
1620-
fi
1609+
# Install Python dependencies from the checked out Zephyr repository.
1610+
pip3 install -r ${ZEPHYR_ROOT}/scripts/requirements.txt
16211611
16221612
- name: Run test suites
16231613
run: |
16241614
# Activate Python virtual environment
1625-
if [ ! -z "${VENV_ACTIVATE}" ]; then
1626-
source ${VENV_ACTIVATE}
1627-
fi
1615+
source ${VENV_ACTIVATE}
16281616
16291617
# Create working directory
16301618
mkdir -p test

0 commit comments

Comments
 (0)