Reduce memory footprint by ~1.5KB for 24/7 IoT operation #18
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-ignore: | |
| - gh-pages | |
| pull_request: | |
| branches-ignore: | |
| - gh-pages | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.8' | |
| - name: Install cpplint | |
| run: pip install cpplint | |
| - name: Run cpplint | |
| run: make cpplint | |
| build: | |
| name: Build Examples | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| example: | |
| - Broadcast | |
| - CustomSettings | |
| - DoorSensor | |
| - GlobalInputHandler | |
| - HookToEvents | |
| - IteadSonoff | |
| - IteadSonoffButton | |
| - LedStrip | |
| - LightOnOff | |
| - Ping | |
| - SingleButton | |
| - SonoffDualShutters | |
| - TemperatureSensor | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.8' | |
| - name: Cache PlatformIO | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.platformio | |
| ~/.cache/pip | |
| key: ${{ runner.os }}-platformio-${{ hashFiles('**/platformio.ini') }} | |
| restore-keys: | | |
| ${{ runner.os }}-platformio- | |
| - name: Install PlatformIO | |
| run: pip install -U platformio | |
| - name: Install Arduino Core for ESP8266 | |
| run: platformio platform install espressif8266 | |
| - name: Install Arduino Core for ESP32 | |
| run: platformio platform install espressif32 | |
| - name: Install Homie library dependencies | |
| run: | | |
| # Install core dependencies from library.json | |
| pio pkg install -g --library "ArduinoJson@~6.11.4" | |
| pio pkg install -g --library "AsyncMqttClient@^0.8.0" | |
| pio pkg install -g --library "Bounce2@^2.1.0" | |
| # Install ESP Async WebServer from GitHub to get the correct version | |
| # that supports both ESP8266 and ESP32 (avoids RP2040W variant) | |
| pio pkg install -g --library "https://github.com/me-no-dev/ESPAsyncWebServer.git" | |
| - name: Install example dependencies | |
| continue-on-error: true | |
| run: | | |
| # Install optional dependencies for SonoffDualShutters example from GitHub | |
| # These libraries are not available in the PlatformIO registry | |
| pio pkg install -g --library "https://github.com/marvinroger/arduino-shutters.git" || true | |
| pio pkg install -g --library "https://github.com/marvinroger/arduino-sonoff-dual.git" || true | |
| - name: Build ${{ matrix.example }} | |
| run: platformio ci ./examples/${{ matrix.example }} --board=esp01_1m --board=nodemcuv2 --board=esp32dev --lib="." | |
| generate-docs: | |
| name: Generate Documentation | |
| runs-on: ubuntu-latest | |
| # Only run on main/master branch, not on PRs | |
| if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop') | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.8' | |
| - name: Install documentation dependencies | |
| run: pip install mkdocs==1.0.4 mkdocs-material==4.6.0 pygments==2.5.2 pymdown-extensions==6.2.1 markdown==3.1.1 | |
| - name: Build documentation | |
| run: | | |
| chmod +x ./.circleci/assets/generate_docs.py | |
| ./.circleci/assets/generate_docs.py -o /tmp/site | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| if: success() | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: /tmp/site | |
| publish_branch: gh-pages | |
| user_name: 'github-actions[bot]' | |
| user_email: 'github-actions[bot]@users.noreply.github.com' | |
| commit_message: ':package: Deploy documentation from ${{ github.sha }}' |