Fix digitalPin: use static state variable like original library #37
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: Build | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # ESP32 | |
| - name: ESP32 | |
| example: examples/ESP32/ESP32.ino | |
| board: esp32dev | |
| platform: espressif32 | |
| lib_deps: "" | |
| - name: ESP32Eth | |
| example: examples/ESP32/ESP32Eth/ESP32Eth.ino | |
| board: esp32dev | |
| platform: espressif32 | |
| lib_deps: "" | |
| - name: ESP32OTA | |
| example: examples/ESP32/ESP32OTA/ESP32OTA.ino | |
| board: esp32dev | |
| platform: espressif32 | |
| lib_deps: "" | |
| - name: ESP32RTOS | |
| example: examples/ESP32/ESP32RTOS/ESP32RTOS.ino | |
| board: esp32dev | |
| platform: espressif32 | |
| lib_deps: "" | |
| - name: ESP32WebConfig | |
| example: examples/ESP32/ESP32WebConfig/ESP32WebConfig.ino | |
| board: esp32dev | |
| platform: espressif32 | |
| lib_deps: "tzapu/WiFiManager" | |
| - name: ESP32S3 | |
| example: examples/ESP32/ESP32S3/ESP32S3.ino | |
| board: esp32-s3-devkitc-1 | |
| platform: espressif32 | |
| lib_deps: "" | |
| - name: ESP32C3 | |
| example: examples/ESP32/ESP32C3/ESP32C3.ino | |
| board: esp32-c3-devkitc-02 | |
| platform: espressif32 | |
| lib_deps: "" | |
| # ESP8266 | |
| - name: ESP8266 | |
| example: examples/ESP8266/ESP8266.ino | |
| board: esp12e | |
| platform: espressif8266 | |
| lib_deps: "" | |
| - name: ESP8266OTA | |
| example: examples/ESP8266/ESP8266OTA/ESP8266OTA.ino | |
| board: esp12e | |
| platform: espressif8266 | |
| lib_deps: "" | |
| - name: ESP8266SmartConfig | |
| example: examples/ESP8266/ESP8266SmartConfig/ESP8266SmartConfig.ino | |
| board: esp12e | |
| platform: espressif8266 | |
| lib_deps: "" | |
| - name: ESP8266WebConfig | |
| example: examples/ESP8266/ESP8266WebConfig/ESP8266WebConfig.ino | |
| board: esp12e | |
| platform: espressif8266 | |
| lib_deps: "tzapu/WiFiManager" | |
| # Arduino boards (STM32/SAMD/Renesas) | |
| - name: ArduinoEthernet | |
| example: examples/Arduino/ArduinoEthernet/ArduinoEthernet.ino | |
| board: nucleo_f767zi | |
| platform: ststm32 | |
| lib_deps: "" | |
| - name: ArduinoNanoESP32 | |
| example: examples/Arduino/ArduinoNanoESP32/ArduinoNanoESP32.ino | |
| board: arduino_nano_esp32 | |
| platform: espressif32 | |
| lib_deps: "" | |
| - name: ArduinoGigaR1 | |
| example: examples/Arduino/ArduinoGigaR1/ArduinoGigaR1.ino | |
| board: giga_r1_m7 | |
| platform: ststm32 | |
| lib_deps: "" | |
| - name: ArduinoNano33BLE | |
| example: examples/Arduino/ArduinoNano33BLE/ArduinoNano33BLE.ino | |
| board: nano33ble | |
| platform: nordicnrf52 | |
| lib_deps: "arduino-libraries/Ethernet" | |
| - name: ArduinoMKR1000 | |
| example: examples/Arduino/ArduinoMKR1000/ArduinoMKR1000.ino | |
| board: mkr1000USB | |
| platform: atmelsam | |
| lib_deps: "arduino-libraries/WiFi101" | |
| - name: ArduinoMKR1010 | |
| example: examples/Arduino/ArduinoMKR1010/ArduinoMKR1010.ino | |
| board: mkrwifi1010 | |
| platform: atmelsam | |
| lib_deps: "arduino-libraries/WiFiNINA" | |
| - name: ArduinoNano33IOT | |
| example: examples/Arduino/ArduinoNano33IOT/ArduinoNano33IOT.ino | |
| board: nano_33_iot | |
| platform: atmelsam | |
| lib_deps: "arduino-libraries/WiFiNINA\n arduino-libraries/Arduino_LSM6DS3" | |
| - name: ArduinoR4Wifi | |
| example: examples/Arduino/ArduinoR4Wifi/ArduinoR4Wifi.ino | |
| board: uno_r4_wifi | |
| platform: renesas-ra | |
| lib_deps: "" | |
| - name: ArduinoPortentaH7 | |
| example: examples/Arduino/ArduinoPortentaH7/ArduinoPortentaH7.ino | |
| board: portenta_h7_m7 | |
| platform: ststm32 | |
| lib_deps: "" | |
| - name: ArduinoPortentaH7Ethernet | |
| example: examples/Arduino/ArduinoPortentaH7Ethernet/ArduinoPortentaH7Ethernet.ino | |
| board: portenta_h7_m7 | |
| platform: ststm32 | |
| lib_deps: "" | |
| skip_ethernet_lib: true | |
| - name: ArduinoNanoRP2040 | |
| example: examples/Arduino/ArduinoNanoRP2040/ArduinoNanoRP2040.ino | |
| board: nanorp2040connect | |
| platform: raspberrypi | |
| lib_deps: "arduino-libraries/WiFiNINA" | |
| extra_build_flags: "-DARDUINO_NANO_RP2040_CONNECT" | |
| extra_config: "lib_ldf_mode = chain" | |
| # ArduinoPicoW: Pico W not yet in PlatformIO stable registry | |
| - name: ArduinoOptaWiFi | |
| example: examples/Arduino/ArduinoOptaWiFi/ArduinoOptaWiFi.ino | |
| board: opta | |
| platform: ststm32 | |
| lib_deps: "" | |
| - name: ArduinoOptaEthernet | |
| example: examples/Arduino/ArduinoOptaEthernet/ArduinoOptaEthernet.ino | |
| board: opta | |
| platform: ststm32 | |
| lib_deps: "" | |
| skip_ethernet_lib: true | |
| - name: ArduinoGSM1400 | |
| example: examples/Arduino/ArduinoGSM1400/ArduinoGSM1400.ino | |
| board: mkrgsm1400 | |
| platform: atmelsam | |
| lib_deps: "arduino-libraries/MKRGSM" | |
| - name: ArduinoMKRNB1500 | |
| example: examples/Arduino/ArduinoMKRNB1500/ArduinoMKRNB1500.ino | |
| board: mkrnb1500 | |
| platform: atmelsam | |
| lib_deps: "arduino-libraries/MKRNB" | |
| - name: ArduinoWifi | |
| example: examples/Arduino/ArduinoWifi/ArduinoWifi.ino | |
| board: mkr1000USB | |
| platform: atmelsam | |
| lib_deps: "arduino-libraries/WiFi101" | |
| - name: ArduinoTinyGSM | |
| example: examples/Arduino/ArduinoTinyGSM/ArduinoTinyGSM.ino | |
| board: esp32dev | |
| platform: espressif32 | |
| lib_deps: "vshymanskyy/TinyGSM" | |
| # Ethernet | |
| - name: Ethernet | |
| example: examples/Ethernet/Ethernet.ino | |
| board: nucleo_f767zi | |
| platform: ststm32 | |
| lib_deps: "" | |
| # Legacy | |
| - name: ArduinoENC28J60 | |
| example: examples/Arduino/ArduinoENC28J60/ArduinoENC28J60.ino | |
| board: nucleo_f767zi | |
| platform: ststm32 | |
| lib_deps: "UIPEthernet/UIPEthernet" | |
| - name: SonoffTouch | |
| example: examples/Sonoff/SonoffTouch/SonoffTouch.ino | |
| board: esp12e | |
| platform: espressif8266 | |
| lib_deps: "tzapu/WiFiManager" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - name: Install PlatformIO | |
| run: pip install platformio | |
| - name: Build (${{ matrix.name }}) | |
| run: | | |
| mkdir -p /tmp/build/src /tmp/build/lib | |
| # Copy example files (no subdirectories) | |
| example_dir=$(dirname ${{ matrix.example }}) | |
| find ${example_dir} -maxdepth 1 -type f -exec cp {} /tmp/build/src/ \; | |
| mv /tmp/build/src/*.ino /tmp/build/src/main.cpp | |
| # Link libraries | |
| ln -s $GITHUB_WORKSPACE /tmp/build/lib/iotmp-arduino | |
| git clone --depth 1 https://github.com/thinger-io/IOTMP-Embedded.git /tmp/build/lib/iotmp-embedded | |
| # Determine extra build flags | |
| EXTRA_FLAGS="${{ matrix.extra_build_flags }}" | |
| BUILD_FLAGS="-std=gnu++17${EXTRA_FLAGS:+ $EXTRA_FLAGS}" | |
| # Determine lib_deps (conditionally include arduino-libraries/Ethernet) | |
| ETHERNET_DEP="" | |
| if [ "${{ matrix.skip_ethernet_lib }}" != "true" ]; then | |
| ETHERNET_DEP="arduino-libraries/Ethernet" | |
| fi | |
| # Determine extra config lines | |
| EXTRA_CONFIG="${{ matrix.extra_config }}" | |
| # platformio.ini | |
| cat > /tmp/build/platformio.ini << EOF | |
| [env:build] | |
| platform = ${{ matrix.platform }} | |
| board = ${{ matrix.board }} | |
| framework = arduino | |
| build_flags = ${BUILD_FLAGS} | |
| build_unflags = -std=gnu++11 | |
| lib_deps = | |
| ${ETHERNET_DEP} | |
| ${{ matrix.lib_deps }} | |
| EOF | |
| # Add extra config lines if specified | |
| if [ -n "${EXTRA_CONFIG}" ]; then | |
| echo " ${EXTRA_CONFIG}" >> /tmp/build/platformio.ini | |
| fi | |
| cd /tmp/build && pio run |