name: L475E-IOT01A

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

defaults:
  run:
    working-directory: STMicroelectronics/B-L475E-IOT01A

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest]
        type: [Debug, Release]

    steps:
      - name: Checkout code
        uses: actions/checkout@v2
        with:
          submodules: recursive

      - name: arm-none-eabi-gcc
        uses: ryanwinter/arm-none-eabi-gcc@master
        with:
          release: '10-2021.10'

      - name: Install Ninja
        uses: seanmiddleditch/gha-setup-ninja@v3

      - name: Build binary
        run: |
          cmake -Bbuild -GNinja -DCMAKE_TOOLCHAIN_FILE="../../cmake/arm-gcc-cortex-m4.cmake" -DCMAKE_BUILD_TYPE="${{ matrix.type }}"
          cmake --build build   
