1# Copyright (c) 2023 Intel Corporation.
2# SPDX-License-Identifier: Apache-2.0
3
4name: Misc. Pylib Scripts TestSuite
5
6on:
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
22jobs:
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
55