fix: Allow west commands to be imported from a project subdirectory if manifest is located in subdirectory #1653
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| # yamllint disable rule:truthy | |
| 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 poe 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 | |
| # that do not run across the whole matrix but only once. These poe tasks | |
| # are defined in pyproject.toml. | |
| # 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 | |
| # Running tests in parallel can produce confusing logs and only saves a | |
| # few minutes, so don't do it across the whole matrix. This section is | |
| # not to save time in Github; it is here to make sure pytest-xdist keeps | |
| # working so developers can keep saving time on their workstations. | |
| - os: ubuntu-latest | |
| python-version: '3.13' | |
| task: test-xdist | |
| 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() }} | |
| uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1.2.1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} |