Subversion Repositories ESP8266_P1_Meter

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 raymond 1
name: PlatformIO CI
2
on: [workflow_call, push]
3
jobs:
4
  build:
5
    runs-on: ubuntu-latest
6
    strategy:
7
      matrix:
8
        example:
9
          - name: publish_and_subscribe
10
        board:
11
          - name: lolin_s2_mini
12
            library: library.json
13
            example_root: examples/arduino/espidf_stack/
14
          - name: lolin_c3_mini
15
            library: library.json
16
            example_root: examples/arduino/espidf_stack/
17
          - name: d1_mini
18
            library: library.json.esp8266
19
            example_root: examples/arduino/legacy_stack/
20
 
21
    steps:
22
      - uses: actions/checkout@v6
23
      - uses: actions/cache@v3
24
        with:
25
          path: |
26
            ~/.cache/pip
27
            ~/.platformio/.cache
28
          key: ${{ runner.os }}-pio
29
      - uses: actions/setup-python@v4
30
        with:
31
          python-version: '3.9'
32
      - name: Install PlatformIO Core
33
        run: pip install --upgrade platformio
34
 
35
      - name: Copy library.json to root (if not src is also in root)
36
        run: mv ${{ matrix.board.library }} ./library.json || true
37
        if: ${{ matrix.board.library != './library.json' }}
38
 
39
      - name: Build PlatformIO examples
40
        run: pio ci --lib="." --board=${{ matrix.board.name }} --project-option="build_unflags=-std=gnu++11" --project-option="build_flags=-std=gnu++17"
41
        env:
42
          PLATFORMIO_CI_SRC: ${{ matrix.board.example_root }}${{ matrix.example.name }}