name: stm32 port

on:
  push:
  pull_request:
    paths:
      - '.github/workflows/*.yml'
      - 'tools/**'
      - 'py/**'
      - 'extmod/**'
      - 'shared/**'
      - 'lib/**'
      - 'drivers/**'
      - 'ports/stm32/**'

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  build_stm32:
    strategy:
      fail-fast: false
      matrix:
        ci_func:  # names are functions in ci.sh
          - stm32_pyb_build
          - stm32_build_cmod
          - stm32_nucleo_build
          - stm32_misc_build
    runs-on: ubuntu-22.04
    steps:
    - uses: actions/checkout@v7
    - name: Install packages
      run: tools/ci.sh stm32_setup && tools/ci.sh stm32_path >> $GITHUB_PATH
    - name: Build ci_${{matrix.ci_func }}
      run: tools/ci.sh ${{ matrix.ci_func }}

