name: "eppp_link: build-tests"

on:
  push:
    branches:
      - master
  pull_request:
    types: [opened, synchronize, reopened, labeled]

jobs:
  build_eppp:
    if: contains(github.event.pull_request.labels.*.name, 'eppp') || github.event_name == 'push'
    name: Build
    strategy:
      matrix:
        idf_ver: ["latest", "release-v5.3"]
        test: [ { app: host, path: "examples/host" }, { app: slave, path: "examples/slave" }, { app: test_app, path: "test/test_app" }]
    runs-on: ubuntu-20.04
    container: espressif/idf:${{ matrix.idf_ver }}
    steps:
      - name: Checkout esp-protocols
        uses: actions/checkout@v3
      - name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }}
        shell: bash
        run: |
          . ${IDF_PATH}/export.sh
          pip install idf-component-manager idf-build-apps --upgrade
          python ./ci/build_apps.py ./components/eppp_link/${{matrix.test.path}} -vv --preserve-all
