2020-02-06 06:04:36 +08:00
|
|
|
# Copyright (c) 2020 Linaro Limited.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
name: Zephyr West Command Tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-11-02 02:08:02 +08:00
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- v*-branch
|
2020-02-06 06:04:36 +08:00
|
|
|
paths:
|
|
|
|
- 'scripts/west-commands.yml'
|
|
|
|
- 'scripts/west_commands/**'
|
2020-12-11 03:36:58 +08:00
|
|
|
- '.github/workflows/west_cmds.yml'
|
2020-02-06 06:04:36 +08:00
|
|
|
pull_request:
|
2022-11-02 02:08:02 +08:00
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- v*-branch
|
2020-02-06 06:04:36 +08:00
|
|
|
paths:
|
|
|
|
- 'scripts/west-commands.yml'
|
|
|
|
- 'scripts/west_commands/**'
|
2020-12-11 03:36:58 +08:00
|
|
|
- '.github/workflows/west_cmds.yml'
|
2020-02-06 06:04:36 +08:00
|
|
|
|
|
|
|
jobs:
|
2020-12-16 03:01:25 +08:00
|
|
|
west-commnads:
|
|
|
|
name: West Command Tests
|
2020-02-06 06:04:36 +08:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-10-25 16:20:27 +08:00
|
|
|
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
|
2023-03-18 18:11:12 +08:00
|
|
|
os: [ubuntu-22.04, macos-11, windows-2022]
|
2021-10-06 05:19:16 +08:00
|
|
|
exclude:
|
2023-01-04 03:24:04 +08:00
|
|
|
- os: macos-11
|
|
|
|
python-version: 3.6
|
|
|
|
- os: windows-2022
|
|
|
|
python-version: 3.6
|
2020-02-06 06:04:36 +08:00
|
|
|
steps:
|
|
|
|
- name: checkout
|
2024-01-27 12:26:39 +08:00
|
|
|
uses: actions/checkout@v4
|
2020-02-06 06:04:36 +08:00
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
2022-10-14 02:08:39 +08:00
|
|
|
uses: actions/setup-python@v4
|
2020-02-06 06:04:36 +08:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: cache-pip-linux
|
|
|
|
if: startsWith(runner.os, 'Linux')
|
2024-01-27 12:26:39 +08:00
|
|
|
uses: actions/cache@v4
|
2020-02-06 06:04:36 +08:00
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
|
|
|
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-${{ matrix.python-version }}
|
|
|
|
- name: cache-pip-mac
|
|
|
|
if: startsWith(runner.os, 'macOS')
|
2024-01-27 12:26:39 +08:00
|
|
|
uses: actions/cache@v4
|
2020-02-06 06:04:36 +08:00
|
|
|
with:
|
|
|
|
path: ~/Library/Caches/pip
|
|
|
|
# Trailing '-' was just to get a different cache name
|
|
|
|
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-${{ matrix.python-version }}-
|
|
|
|
- name: cache-pip-win
|
|
|
|
if: startsWith(runner.os, 'Windows')
|
2024-01-27 12:26:39 +08:00
|
|
|
uses: actions/cache@v4
|
2020-02-06 06:04:36 +08:00
|
|
|
with:
|
|
|
|
path: ~\AppData\Local\pip\Cache
|
|
|
|
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-${{ matrix.python-version }}
|
|
|
|
- name: install pytest
|
|
|
|
run: |
|
2020-08-22 06:47:22 +08:00
|
|
|
pip3 install wheel
|
2023-07-06 00:34:56 +08:00
|
|
|
pip3 install pytest west pyelftools canopen natsort progress mypy intelhex psutil ply pyserial
|
2020-02-06 06:04:36 +08:00
|
|
|
- name: run pytest-win
|
|
|
|
if: runner.os == 'Windows'
|
|
|
|
run: |
|
2020-08-22 06:47:22 +08:00
|
|
|
python ./scripts/west_commands/run_tests.py
|
2020-02-06 06:04:36 +08:00
|
|
|
- name: run pytest-mac-linux
|
|
|
|
if: runner.os != 'Windows'
|
|
|
|
run: |
|
2020-08-22 06:47:22 +08:00
|
|
|
./scripts/west_commands/run_tests.py
|