Skip to content

Commit

Permalink
Reuse workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Johboh committed Dec 28, 2023
1 parent 3c21d07 commit ad1da1c
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 69 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/esp_upload_component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,11 @@ name: Push to Espressif Component Service
on:
release:
types: [created]

workflow_run:
workflows: ["ESP-IDF CI"]
types: completed
branch:
- main
jobs:
build_examples_for_verification:
uses: ./.github/workflows/espidf_wf.yaml
upload_components:
runs-on: ubuntu-latest
if: |
github.event_name == 'release' &&
github.event.workflow_run.conclusion == 'success'
steps:
- uses: actions/checkout@master
- name: Upload component to component registry
Expand Down
28 changes: 2 additions & 26 deletions .github/workflows/espidf.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@
name: ESP-IDF CI
on: [push]
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 }}
build_examples:
uses: ./.github/workflows/espidf_wf.yaml
29 changes: 29 additions & 0 deletions .github/workflows/espidf_wf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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 }}
27 changes: 2 additions & 25 deletions .github/workflows/platformio.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,5 @@
name: PlatformIO CI
on: [push]
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 }}
build_examples:
uses: ./.github/workflows/platformio_wf.yaml
11 changes: 2 additions & 9 deletions .github/workflows/platformio_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,11 @@ name: Push to PlatformIO registry
on:
release:
types: [created]

workflow_run:
workflows: ["PlatformIO CI"]
types: completed
branch:
- main
jobs:
build_examples_for_verification:
uses: ./.github/workflows/platformio_wf.yaml
upload_library:
runs-on: ubuntu-latest
if: |
github.event_name == 'release' &&
github.event.workflow_run.conclusion == 'success'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/platformio_wf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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 }}

0 comments on commit ad1da1c

Please sign in to comment.