Skip to content

Commit

Permalink
update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieucarbou committed Sep 6, 2024
1 parent f35d15b commit 4468959
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 66 deletions.
92 changes: 54 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build-arduino:
name: ${{ matrix.config }}
Expand All @@ -28,55 +32,67 @@ jobs:
LWIP_IPV6: true
run: arduino-cli --config-file ${{ matrix.config }} --library ./src/ compile --fqbn esp32:esp32:esp32 ./examples/ClientServer/Client/Client.ino

pio_envs:
name: Get PlatformIO Envs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
key: pip
path: ~/.cache/pip
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Get Envs
id: envs
run: |
echo "pio_default_envs=$(pio project config --json-output | jq -cr '[ .[][0] | select(startswith("env:") and (endswith("-debug")|not)) | .[4:] ]')" >> $GITHUB_OUTPUT
outputs:
pio_default_envs: ${{ steps.envs.outputs.pio_default_envs }}

build-pio:
name: "pio:${{ matrix.environment }}"
needs: [pio_envs]
platformio:
name: "pio:${{ matrix.env }}:${{ matrix.board }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
environment: ${{ fromJSON(needs.pio_envs.outputs.pio_default_envs) }}
include:
- env: ci-arduino-2
board: esp32dev
- env: ci-arduino-2
board: esp32-s2-saola-1
- env: ci-arduino-2
board: esp32-s3-devkitc-1
- env: ci-arduino-2
board: esp32-c3-devkitc-02

- env: ci-arduino-3
board: esp32dev
- env: ci-arduino-3
board: esp32-s2-saola-1
- env: ci-arduino-3
board: esp32-s3-devkitc-1
- env: ci-arduino-3
board: esp32-c3-devkitc-02
- env: ci-arduino-3
board: esp32-c6-devkitc-1
- env: ci-arduino-3
board: esp32-h2-devkitm-1

- env: ci-arduino-310rc1
board: esp32dev
- env: ci-arduino-310rc1
board: esp32-s2-saola-1
- env: ci-arduino-310rc1
board: esp32-s3-devkitc-1
- env: ci-arduino-310rc1
board: esp32-c3-devkitc-02
- env: ci-arduino-310rc1
board: esp32-c6-devkitc-1
- env: ci-arduino-310rc1
board: esp32-h2-devkitm-1

steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
- name: Checkout
uses: actions/checkout@v4

- name: Cache PlatformIO
uses: actions/cache@v4
with:
key: ${{ runner.os }}-pio
path: |
~/.platformio
~/.cache/pip
key: pio
- uses: actions/setup-python@v5
~/.platformio
- name: Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- run: pip install platformio

- name: Install platformio
- name: Build
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- run: PLATFORMIO_SRC_DIR=examples/ClientServer/Client pio run -e ${{ matrix.environment }}
- run: PLATFORMIO_SRC_DIR=examples/ClientServer/Client PIO_BOARD=${{ matrix.board }} pio run -e ${{ matrix.env }}
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tasks:
- command: pip install --upgrade pip && pip install -U platformio && platformio run -e dev
- command: pip install --upgrade pip && pip install -U platformio && platformio run

image:
file: .gitpod.Dockerfile
Expand Down
40 changes: 13 additions & 27 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,32 @@ build_flags =
upload_protocol = esptool
monitor_speed = 115200
monitor_filters = esp32_exception_decoder, log2file
board = esp32dev

[platformio]
default_envs = arduino-2, arduino-3, arduino-310rc1
lib_dir = .
src_dir = examples/ClientServer/Client

[env:arduino]
platform = espressif32
board = esp32dev

[env:arduino-2]
platform = espressif32@6.8.1
board = esp32dev

[env:arduino-3]
platform = espressif32
platform_packages=
platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.4
platformio/framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip
board = esp32dev

[env:pioarduino-esp32dev]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.04/platform-espressif32.zip
board = esp32dev

[env:pioarduino-esp32-s2]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.04/platform-espressif32.zip
board = esp32-s2-saola-1
[env:arduino-310rc1]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.10%%2Brc1/platform-espressif32.zip

[env:pioarduino-esp32-s3]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.04/platform-espressif32.zip
board = esp32-s3-devkitc-1
; CI

[env:pioarduino-esp32-c3]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.04/platform-espressif32.zip
board = esp32-c3-devkitc-02
[env:ci-arduino-2]
platform = espressif32@6.8.1
board = ${sysenv.PIO_BOARD}

[env:pioarduino-esp32-c6]
[env:ci-arduino-3]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.04/platform-espressif32.zip
board = esp32-c6-devkitc-1
board = ${sysenv.PIO_BOARD}

[env:pioarduino-h2]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.04/platform-espressif32.zip
board = esp32-h2-devkitm-1
[env:ci-arduino-310rc1]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.10%%2Brc1/platform-espressif32.zip
board = ${sysenv.PIO_BOARD}

0 comments on commit 4468959

Please sign in to comment.