Skip to content

west: add --color option to control output colorization #1593

west: add --color option to control output colorization

west: add --color option to control output colorization #1593

Workflow file for this run

name: Python Test
on: [push, pull_request]
permissions:
contents: read
# Cancel ongoing builds on new changes
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Run tasks
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
task: [gh-test]
# The include map here is actually used to extend the matrix.
# By passing all keys used in the matrix we append new unique combinations.
# For more information see:
# https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#example-adding-configurations
include:
# Run linter/type checks only on 1 combination
- os: ubuntu-latest
python-version: '3.13'
task: test
- os: ubuntu-latest
python-version: '3.13'
task: gh-lint
- os: ubuntu-latest
python-version: '3.13'
task: gh-format
- os: ubuntu-latest
python-version: '3.13'
task: types
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# This is enough to find many quoting issues
with:
path: "./check out"
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1
with:
python-version: ${{ matrix.python-version }}
working-directory: './check out/'
enable-cache: true
- name: Setup project
run: uv sync --frozen --directory "./check out/"
- name: Display Python version
run: echo "import sys; print(sys.version); print(sys.platform)" | uv run -
- name: Run ${{ matrix.task }} on ${{ matrix.os }} - ${{ matrix.python-version }}
run: uv run --frozen --directory "./check out/" --env-file=.github/http_env_block.conf poe ${{ matrix.task }}
- name: Upload coverage reports
if: ${{ matrix.task == 'gh-test' }}
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: coverage-${{ matrix.os }}-${{ matrix.python-version }}
path: "./check out/.coverage"
include-hidden-files: true
- name: Upload test reports
if: ${{ matrix.task == 'gh-test' }}
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: tests-${{ matrix.os }}-${{ matrix.python-version }}
path: "./check out/junit.xml"
test-report:
name: Report test results
runs-on: ubuntu-latest
needs: ["build"]
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.13'
- name: Download all artifacts
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
- name: Install coverage
run: pip3 install coverage
- name: Create coverage report
run: |
coverage combine coverage-*/.coverage
coverage xml
- name: Upload combined coverage report
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: coverage-combined
path: coverage.xml
- name: Upload coverage to Codecov
if: github.repository_owner == 'zephyrproject-rtos'
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
if: github.repository_owner == 'zephyrproject-rtos' && ${{ !cancelled() }}

Check warning on line 120 in .github/workflows/test.yml

View workflow run for this annotation

GitHub Actions / Python Test

Workflow syntax warning

.github/workflows/test.yml (Line: 120, Col: 13): Conditional expression contains literal text outside replacement tokens. This will cause the expression to always evaluate to truthy. Did you mean to put the entire expression inside ${{ }}?
uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1.2.1
with:
token: ${{ secrets.CODECOV_TOKEN }}