Create MCU stubs #170
This file contains 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
name: Create MCU stubs | |
on: | |
workflow_dispatch: | |
# schedule: | |
# - cron: "0 23 * * *" | |
push: | |
# branches: | |
# - main | |
paths: | |
- .github/workflows/createstubs.yml | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
######################################################################################################################################## | |
list-versions-cs: | |
# 'Get a matrix for the latest versions of micropython' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- uses: ./.github/actions/get-mpversions | |
id: dynamic | |
outputs: | |
versions: ${{ steps.dynamic.outputs.versions }} | |
######################################################################################################################################## | |
createstubs: | |
needs: list-versions-cs | |
runs-on: [self-hosted, mpremote, X64] | |
env: | |
ARCH: X64 | |
# ARCH: ARM64 | |
strategy: | |
max-parallel: 1 # only one version at a time | |
fail-fast: false # keep on trying each version even if one fails | |
matrix: ${{ fromJSON(needs.list-versions-cs.outputs.versions) }} | |
steps: | |
- name: Checkout stubs repo | |
uses: actions/checkout@v4 | |
- name: Set up Python (most platforms) | |
if: ${{ env.ARCH != 'ARM64' }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Set up Python (Linux-ARM64) | |
if: ${{ env.ARCH == 'ARM64' }} | |
uses: deadsnakes/[email protected] | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
pipx install poetry | |
pip install -U -r requirements.txt | |
- name: Patch mpremote/mip.py | |
continue-on-error: true | |
run: | | |
MODULE_LOCATION=$(pip show -f mpremote | grep Location | cut -d' ' -f2) | |
patch --forward $MODULE_LOCATION/mpremote/mip.py ./mpremote_mip.patch || true | |
- name: Get ${{ matrix.version }} firmwares for flashing | |
run: | | |
mpflash download --version ${{ matrix.version }} | |
- name: Update firmware to ${{ matrix.version }} on all connected boards | |
run: | | |
mpflash flash --version ${{ matrix.version }} | |
- name: clone Repos | |
run: | | |
stubber clone | |
- name: Get/update docstubs | |
run: | | |
stubber switch ${{ matrix.version }} | |
stubber get-docstubs | |
- name: Run board stubber | |
run: | | |
stubber get-mcu-stubs | |
- name: commit | |
continue-on-error: true | |
uses: ./.github/actions/commit | |
with: | |
message: "Update boardstubs for ${{ matrix.version }}" | |
- name: Build App | |
if: always() | |
run: echo "Done." | |