name: Build Examples

on:
  push:
    branches:
      - master
jobs:
  build-examples:
    strategy:
      matrix:
        example:
          - Async-Server
          - Authentication
          - HTML-Forms
          - HTTPS-and-HTTP
          - Middleware
          - Parameters
          - Parameter-Validation
          - Put-Post-Echo
          - REST-API
          - Self-Signed-Certificate
          - Static-Page
          - Websocket-Chat
        board:
          - wrover
          - wroom
    runs-on: ubuntu-latest
    steps:
    - name: Checkout codebase
      uses: actions/checkout@f90c7b395dac7c5a277c1a6d93d5057c1cddb74e
    - name: Set up Python
      uses: actions/setup-python@9ac730844c47e52575257e93faf193c4530bc095
      with:
        python-version: '3.8'
    - name: Install PlatformIO
      run: |
        python -m pip install --upgrade pip
        pip install platformio
    - name: Build example
      run: ./extras/ci/scripts/build-example.sh ${{ matrix.board }} ${{ matrix.example }}
