This repository was archived by the owner on Aug 3, 2026. It is now read-only.
Merge pull request #4 from ESPToolKit/feature/esp-webpush-v2 #25
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ main, master, 'feature/**' ] | |
| tags: ['v*'] | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| build-examples: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| board: [esp32dev, esp32-s3-devkitc-1, esp32-c3-devkitm-1, esp32-p4-evboard] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Cache PlatformIO | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.platformio | |
| key: ${{ runner.os }}-platformio-${{ hashFiles('**/library.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-platformio- | |
| - name: Install PIOArduino Core | |
| run: python -m pip install --upgrade https://github.com/pioarduino/platformio-core/archive/refs/tags/v6.1.18.zip | |
| - name: Install PIOArduino ESP32 Platform | |
| run: pio platform install https://github.com/pioarduino/platform-espressif32.git | |
| - name: Build library examples (ESP32 Arduino) | |
| run: | | |
| set -e | |
| for d in examples/*; do | |
| if [ -d "$d" ]; then | |
| echo "Building $d on ${{ matrix.board }} via PlatformIO CI" | |
| pio ci "$d" \ | |
| --board ${{ matrix.board }} \ | |
| --lib="." \ | |
| --project-option "platform=https://github.com/pioarduino/platform-espressif32.git" \ | |
| --project-option "build_unflags=-std=gnu++11" \ | |
| --project-option "build_flags=-std=gnu++17" \ | |
| --project-option "lib_deps=ArduinoJson@>=7.0.0" | |
| fi | |
| done | |
| espidf-smoke: | |
| runs-on: ubuntu-latest | |
| needs: build-examples | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Cache PlatformIO | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.platformio | |
| key: ${{ runner.os }}-platformio-${{ hashFiles('**/library.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-platformio- | |
| - name: Install PIOArduino Core | |
| run: python -m pip install --upgrade https://github.com/pioarduino/platformio-core/archive/refs/tags/v6.1.18.zip | |
| - name: Install PIOArduino ESP32 Platform | |
| run: pio platform install https://github.com/pioarduino/platform-espressif32.git | |
| - name: Build ESP-IDF smoke target | |
| run: | | |
| set -euo pipefail | |
| tmpdir="$(mktemp -d)" | |
| cat > "${tmpdir}/main.cpp" <<'EOF' | |
| #include <ESPWebPush.h> | |
| extern "C" void app_main(void) { | |
| ESPWebPush webPush; | |
| WebPushVapidConfig vapid{}; | |
| vapid.subject = "mailto:test@example.com"; | |
| } | |
| EOF | |
| pio ci "${tmpdir}/main.cpp" \ | |
| --board esp32dev \ | |
| --lib="." \ | |
| --project-option "platform=https://github.com/pioarduino/platform-espressif32.git" \ | |
| --project-option "framework=espidf" \ | |
| --project-option "build_unflags=-std=gnu++11" \ | |
| --project-option "build_flags=-std=gnu++17" \ | |
| --project-option "lib_deps=ArduinoJson@>=7.0.0" | |
| arduino-cli: | |
| runs-on: ubuntu-latest | |
| needs: [build-examples, espidf-smoke] | |
| env: | |
| ESP32_CORE_VERSION: 3.3.3 | |
| ESP32_PACKAGE_URL: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json | |
| ARDUINO_BOARDS: | | |
| esp32:esp32:esp32 esp32dev | |
| esp32:esp32:esp32s3 esp32-s3-devkitc-1 | |
| esp32:esp32:esp32c3 esp32-c3-devkitm-1 | |
| esp32:esp32:esp32p4 esp32-p4-evboard | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Arduino CLI | |
| uses: arduino/setup-arduino-cli@v1 | |
| - name: Prepare Arduino directories | |
| run: | | |
| mkdir -p "${HOME}/.arduino15" | |
| mkdir -p "${HOME}/Arduino/libraries" | |
| - name: Cache Arduino dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.arduino15 | |
| ~/Arduino/libraries | |
| key: ${{ runner.os }}-arduino-esp32-${{ env.ESP32_CORE_VERSION }}-${{ hashFiles('library.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-arduino-esp32-${{ env.ESP32_CORE_VERSION }}- | |
| ${{ runner.os }}-arduino-esp32- | |
| - name: Configure board manager for ESP32 | |
| run: | | |
| set -e | |
| arduino-cli config init --overwrite | |
| arduino-cli config set library.enable_unsafe_install true | |
| arduino-cli config add board_manager.additional_urls "${ESP32_PACKAGE_URL}" | |
| arduino-cli config dump | |
| - name: Install ESP32 core | |
| run: | | |
| arduino-cli core update-index --additional-urls "${ESP32_PACKAGE_URL}" | |
| arduino-cli core install esp32:esp32@${ESP32_CORE_VERSION} --additional-urls "${ESP32_PACKAGE_URL}" | |
| - name: Install libraries (ArduinoJson v7+) | |
| run: | | |
| arduino-cli lib update-index | |
| arduino-cli lib install "ArduinoJson" | |
| - name: Add local library to sketchbook | |
| run: | | |
| set -e | |
| SKETCHBOOK_DIR="${HOME}/Arduino" | |
| mkdir -p "$SKETCHBOOK_DIR/libraries/ESPWebPush" | |
| rsync -a --delete --exclude ".git" ./ "$SKETCHBOOK_DIR/libraries/ESPWebPush/" | |
| - name: Build examples | |
| env: | |
| BOARDS: ${{ env.ARDUINO_BOARDS }} | |
| run: | | |
| set -euo pipefail | |
| while read -r fqbn board_name; do | |
| if [ -z "$fqbn" ]; then | |
| continue | |
| fi | |
| echo "::group::Compiling examples for ${board_name} (${fqbn})" | |
| for d in examples/*; do | |
| if [ -d "$d" ]; then | |
| echo "Compiling $d" | |
| arduino-cli compile --fqbn "$fqbn" "$d" | |
| fi | |
| done | |
| echo "::endgroup::" | |
| done <<< "$BOARDS" |