Fix non-static functions errors #139
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: Compile Library | |
| on: | |
| push: | |
| paths-ignore: | |
| - '.github/workflows/cpp_lint.yml' | |
| - '.github/workflows/compile_examples.yml' | |
| - 'examples/**' | |
| pull_request: | |
| paths-ignore: | |
| - '.github/workflows/cpp_lint.yml' | |
| - '.github/workflows/compile_examples.yml' | |
| - 'examples/**' | |
| jobs: | |
| # --- CONSOLIDATED JOB FOR MOST BOARDS --- | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| board_config: | |
| # --- ESP/Arduino Boards --- | |
| - { board: d1_mini, name: 'd1_mini (ESP8266)' } | |
| - { board: nodemcuv2, name: 'nodemcuv2 (ESP8266)' } | |
| - { board: esp32dev, name: 'esp32dev (ESP32)' } | |
| - { board: lolin32, name: 'lolin32 (ESP32)' } | |
| - { board: esp32-s3-devkitc-1, name: 'esp32-s3-devkitc-1 (ESP32-S3)' } | |
| - { board: esp32-c3-devkitc-02, name: 'esp32-c3-devkitc-02 (ESP32-C3)' } | |
| - { board: mkrwifi1010, name: 'mkrwifi1010 (Arduino MKR)' } | |
| - { board: mkr1000USB, name: 'mkr1000USB (Arduino MKR)' } | |
| - { board: uno_r4_wifi, name: 'uno_r4_wifi (Arduino R4)' } | |
| - { board: megaatmega2560, name: 'Arduino Mega 2560' } # <-- NEW BOARD ID | |
| # --- Teensy Boards --- | |
| - { board: teensy41, name: 'teensy41' } | |
| - { board: teensy31, name: 'teensy32' } | |
| # --- STM32 Boards --- | |
| - { board: bluepill_f103c8_128k, name: 'bluepill_f103c8 (STM32F1)' } | |
| - { board: nucleo_f401re, name: 'nucleo_f401re (STM32F4 Nucleo)' } | |
| # --- RP2040 Board (Requires Configuration) --- | |
| - { board: nanorp2040connect, name: 'nanorp2040connect', needs_ini: true } | |
| name: Build ${{ matrix.board_config.name }} | |
| steps: | |
| - name: ⬇️ Checkout Repository | |
| uses: actions/checkout@v4 | |
| # --- Caching --- | |
| - name: 💾 Cache pip | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
| restore-keys: ${{ runner.os }}-pip- | |
| - name: 💾 Cache PlatformIO | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.platformio | |
| key: ${{ runner.os }}-${{ matrix.board_config.name }}-${{ hashFiles('**/lockfiles') }} | |
| restore-keys: ${{ runner.os }}-${{ matrix.board_config.name }}- | |
| # --- Setup --- | |
| - name: 🐍 Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: 🛠️ Install PlatformIO | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install --upgrade platformio | |
| # --- SKETCH CREATION (Updated with your code) --- | |
| - name: 📝 Create minimal sketch with test code | |
| if: ${{ !matrix.board_config.needs_ini }} | |
| run: | | |
| mkdir -p src | |
| # Write the specific test code to a .cpp file for better C++ compilation | |
| cat << EOF > src/main.cpp | |
| #include <Arduino.h> | |
| #include <ESP_SSLClient.h> | |
| ESP_SSLClient ssl_client; | |
| void setup() | |
| { | |
| // NOTE: Library functions will be checked for existence, | |
| // but linker errors might still occur on non-ESP boards | |
| // if the library has dependencies that aren't mocked/installed. | |
| ssl_client.setInsecure(); | |
| ssl_client.setBufferSizes(2048, 512); | |
| ssl_client.connect("mock.com", 443); | |
| ssl_client.stop(); | |
| } | |
| void loop() | |
| { | |
| } | |
| EOF | |
| # --- Conditional Configuration for nanorp2040connect --- | |
| - name: 📝 Create nanorp2040connect platformio.ini and sketch | |
| if: ${{ matrix.board_config.needs_ini }} | |
| run: | | |
| echo "[env:nanorp2040connect]" >> platformio.ini | |
| echo "platform = raspberrypi" >> platformio.ini | |
| echo "board = nanorp2040connect" >> platformio.ini | |
| echo "framework = arduino" >> platformio.ini | |
| echo "lib_deps = WiFiNINA" >> platformio.ini | |
| # Create a minimal sketch for this board (kept generic for lib_deps reasons) | |
| mkdir -p src | |
| echo "#include <Arduino.h>" >> src/main.ino | |
| echo "#include <SPI.h>" >> src/main.ino | |
| echo "void setup() {}" >> src/main.ino | |
| echo "void loop() {}" >> src/main.ino | |
| # --- Compile --- | |
| - name: ⚙️ Run PlatformIO Compile | |
| run: | | |
| if [ "${{ matrix.board_config.needs_ini }}" = "true" ]; then | |
| # Boards with specific INI configuration: source is 'src' | |
| pio ci --project-conf="platformio.ini" --project-option="lib_ldf_mode=chain+" src | |
| else | |
| # Standard boards: Use the 'src' folder we just created | |
| pio ci --board=${{ matrix.board_config.board }} src | |
| fi | |
| # --- SEPARATE JOB FOR PICO W (due to custom platform URL) --- | |
| picow: | |
| runs-on: ubuntu-latest | |
| name: Build Pico W (Custom Platform) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Caching steps | |
| - name: 💾 Cache pip | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
| restore-keys: ${{ runner.os }}-pip- | |
| - name: 💾 Cache PlatformIO | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.platformio | |
| key: ${{ runner.os }}-picow-${{ hashFiles('**/lockfiles') }} | |
| restore-keys: ${{ runner.os }}-picow- | |
| - name: 🐍 Set up Python | |
| 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: 📝 Create Pico W platformio.ini and sketch | |
| run: | | |
| # Create the platformio.ini with the custom platform URL | |
| echo "[env:rpipicow]" >> platformio.ini | |
| echo "platform = https://github.com/maxgerhardt/platform-raspberrypi.git" >> platformio.ini | |
| echo "board = rpipicow" >> platformio.ini | |
| echo "framework = arduino" >> platformio.ini | |
| echo "board_build.core = earlephilhower" >> platformio.ini | |
| echo "board_build.filesystem_size = 1m" >> platformio.ini | |
| # Create a minimal sketch | |
| mkdir -p src | |
| echo "#include <Arduino.h>" >> src/main.ino | |
| echo "#include <LwipEthernet.h>" >> src/main.ino | |
| echo "void setup() {}" >> src/main.ino | |
| echo "void loop() {}" >> src/main.ino | |
| - name: ⚙️ Run PlatformIO Compile | |
| # Compile using the generated INI | |
| run: pio ci --project-conf="platformio.ini" src |