diff --git a/.github/workflows/esp_upload_component.yaml b/.github/workflows/esp_upload_component.yaml index 772f1e3..b392374 100644 --- a/.github/workflows/esp_upload_component.yaml +++ b/.github/workflows/esp_upload_component.yaml @@ -4,9 +4,10 @@ on: types: [created] jobs: build_examples_for_verification: - uses: ./.github/workflows/espidf_wf.yaml + uses: ./.github/workflows/espidf.yaml upload_components: runs-on: ubuntu-latest + needs: [build_examples_for_verification] steps: - uses: actions/checkout@master - name: Upload component to component registry diff --git a/.github/workflows/espidf.yaml b/.github/workflows/espidf.yaml index dc24691..85f17cb 100644 --- a/.github/workflows/espidf.yaml +++ b/.github/workflows/espidf.yaml @@ -1,5 +1,29 @@ name: ESP-IDF CI -on: [push] +on: [workflow_call, push] jobs: - build_examples: - uses: ./.github/workflows/espidf_wf.yaml \ No newline at end of file + esp_idf_build: + runs-on: ubuntu-latest + strategy: + matrix: + version: + - name: v4_build + version_number: v4.4.3 + target: esp32c3 + - name: v5_build + version_number: v5.1.2 + target: esp32c6 + example: + - name: publish_and_subscribe + + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + submodules: 'recursive' + + - name: ESP-IDF Build + uses: espressif/esp-idf-ci-action@v1 + with: + esp_idf_version: ${{ matrix.version.version_number }} + target: ${{ matrix.version.target }} + path: examples/espidf/${{ matrix.example.name }} \ No newline at end of file diff --git a/.github/workflows/espidf_wf.yaml b/.github/workflows/espidf_wf.yaml deleted file mode 100644 index c73f322..0000000 --- a/.github/workflows/espidf_wf.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: ESP-IDF CI Workflow -on: [workflow_call] -jobs: - esp_idf_build: - runs-on: ubuntu-latest - strategy: - matrix: - version: - - name: v4_build - version_number: v4.4.3 - target: esp32c3 - - name: v5_build - version_number: v5.1.2 - target: esp32c6 - example: - - name: publish_and_subscribe - - steps: - - name: Checkout repo - uses: actions/checkout@v2 - with: - submodules: 'recursive' - - - name: ESP-IDF Build - uses: espressif/esp-idf-ci-action@v1 - with: - esp_idf_version: ${{ matrix.version.version_number }} - target: ${{ matrix.version.target }} - path: examples/espidf/${{ matrix.example.name }} \ No newline at end of file diff --git a/.github/workflows/platformio.yaml b/.github/workflows/platformio.yaml index a36b03a..75504e8 100644 --- a/.github/workflows/platformio.yaml +++ b/.github/workflows/platformio.yaml @@ -1,5 +1,28 @@ name: PlatformIO CI -on: [push] +on: [workflow_call, push] jobs: - build_examples: - uses: ./.github/workflows/platformio_wf.yaml \ No newline at end of file + build: + runs-on: ubuntu-latest + strategy: + matrix: + example: + - name: publish_and_subscribe + + steps: + - uses: actions/checkout@v3 + - uses: actions/cache@v3 + with: + path: | + ~/.cache/pip + ~/.platformio/.cache + key: ${{ runner.os }}-pio + - uses: actions/setup-python@v4 + with: + python-version: '3.9' + - name: Install PlatformIO Core + run: pip install --upgrade platformio + + - name: Build PlatformIO examples + run: pio ci --lib="." --board=lolin_s2_mini --board=lolin_c3_mini --board="d1_mini" + env: + PLATFORMIO_CI_SRC: examples/arduino/${{ matrix.example.name }} \ No newline at end of file diff --git a/.github/workflows/platformio_publish.yaml b/.github/workflows/platformio_publish.yaml index 9bfb82d..3b57031 100644 --- a/.github/workflows/platformio_publish.yaml +++ b/.github/workflows/platformio_publish.yaml @@ -4,9 +4,10 @@ on: types: [created] jobs: build_examples_for_verification: - uses: ./.github/workflows/platformio_wf.yaml + uses: ./.github/workflows/platformio.yaml upload_library: runs-on: ubuntu-latest + needs: [build_examples_for_verification] steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 diff --git a/.github/workflows/platformio_wf.yaml b/.github/workflows/platformio_wf.yaml deleted file mode 100644 index 62e3add..0000000 --- a/.github/workflows/platformio_wf.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: PlatformIO CI Workflow -on: [workflow_call] -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - example: - - name: publish_and_subscribe - - steps: - - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: | - ~/.cache/pip - ~/.platformio/.cache - key: ${{ runner.os }}-pio - - uses: actions/setup-python@v4 - with: - python-version: '3.9' - - name: Install PlatformIO Core - run: pip install --upgrade platformio - - - name: Build PlatformIO examples - run: pio ci --lib="." --board=lolin_s2_mini --board=lolin_c3_mini --board="d1_mini" - env: - PLATFORMIO_CI_SRC: examples/arduino/${{ matrix.example.name }} \ No newline at end of file