releases now trigger directly on push.tags: ['v*'] #4
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 ] | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| 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=\nArduinoJson@>=7.0.0' | |
| fi | |
| done | |
| arduino-cli: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| board: | |
| - fqbn: esp32:esp32:esp32 | |
| name: esp32dev | |
| - fqbn: esp32:esp32:esp32s3 | |
| name: esp32-s3-devkitc-1 | |
| - fqbn: esp32:esp32:esp32c3 | |
| name: esp32-c3-devkitm-1 | |
| - fqbn: esp32:esp32:esp32p4 | |
| name: esp32-p4-evboard | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Arduino CLI | |
| uses: arduino/setup-arduino-cli@v1 | |
| - name: Install ESP32 core | |
| run: | | |
| arduino-cli core update-index | |
| arduino-cli core install esp32:esp32 | |
| - name: Install libraries | |
| 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/ESPBufferManager" | |
| rsync -a --delete --exclude ".git" ./ "$SKETCHBOOK_DIR/libraries/ESPBufferManager/" | |
| - name: Build examples (${{ matrix.board.name }}) | |
| env: | |
| FQBN: ${{ matrix.board.fqbn }} | |
| run: | | |
| set -e | |
| for d in examples/*; do | |
| if [ -d "$d" ]; then | |
| echo "Compiling $d" | |
| arduino-cli compile --fqbn "$FQBN" "$d" | |
| fi | |
| done | |
| package-library: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build-examples | |
| - arduino-cli | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Install PIOArduino Core | |
| run: python -m pip install --upgrade https://github.com/pioarduino/platformio-core/archive/refs/tags/v6.1.18.zip | |
| - name: Pack library (PlatformIO) | |
| run: | | |
| mkdir -p dist | |
| pio pkg pack --output dist | |
| - name: Upload package artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: espbuffermanager-${{ github.sha }} | |
| path: dist/* |