Flash backend, PyOCD and MPBuild integration #406
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
| # This workflow will : | |
| # - test mpflash | |
| # - upload coverage stats to Codecov | |
| # - upload artifacts from the results folder | |
| name: pytest_mpflash | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| # branches: [main] | |
| push: | |
| # branches: [main, dev/*, mpflash/*, feat/*, fix/*] # ALL | |
| paths: | |
| - .github/workflows/pytest_mpflash.yml | |
| - .github/workflows/codecov.yml | |
| - "mpflash/**" | |
| - "pyproject.toml" | |
| - "poetry.lock" | |
| - "tests" | |
| env: | |
| PYTHONIOENCODING: utf-8 | |
| # fix: DeprecationWarning: Jupyter is migrating its paths to use standard platformdirs | |
| JUPYTER_PLATFORM_DIRS: "1" | |
| # Opt into Node.js 24 for all JavaScript actions ahead of runner default switch. | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test_mpflash: | |
| name: Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| # include: # for testing | |
| # - os: ubuntu-latest | |
| # python-version: "3.11" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-tags: true | |
| #---------------------------------------------- | |
| # uv is not in the default image | |
| #---------------------------------------------- | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@v8.2.0 | |
| with: | |
| version: "latest" | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| # cache: "poetry" | |
| #---------------------------------------------- | |
| # install project | |
| #---------------------------------------------- | |
| - name: Install mpflash & test dependencies (all extras) | |
| run: uv sync --all-extras | |
| - name: Test mpflash | |
| run: | | |
| # run once to bootstrap database (test hack) | |
| uv run mpflash download --board RPI_PICO | |
| uv run pytest --cov --cov-branch --cov-report=xml | |
| #---------------------------------------------- | |
| # upload coverage stats | |
| # .XML to Codecov | |
| #---------------------------------------------- | |
| - name: Upload coverage-mpflash-*.xml to Codecov | |
| if: always() # ignore errors | |
| continue-on-error: true | |
| uses: codecov/codecov-action@v7 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| # file: results/coverage-mpflash-${{ matrix.python-version }}-${{ matrix.os }}.xml | |
| # flags: mpflash | |