Skip to content

Commit

Permalink
Update action
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisxhe committed Oct 17, 2023
1 parent 21eddf2 commit e552cdd
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 5 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/arduino_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Arduino_CI

on:
pull_request:
push:
paths:
- "examples/**"
- "src/**"

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
board: ["esp32:esp32:esp32s3"]
examples:
[
examples/AXP192_Example/AXP192_Example.ino,
examples/AXP202_Example/AXP202_Example.ino,
examples/AXP2101_ADC_Example/AXP2101_ADC_Example.ino,
examples/AXP2101_Charge_Example/AXP2101_Charge_Example.ino,
examples/AXP2101_Example/AXP2101_Example.ino,
examples/AXP2101_InterruptExample/AXP2101_InterruptExample.ino,
examples/AXP2101_Sleep_Example/AXP2101_Sleep_Example.ino,
examples/AXP2101_Voltage_Example/AXP2101_Voltage_Example.ino,
examples/SY6970_Example/SY6970_Example.ino,
examples/SY6970_Watchdog_Example/SY6970_Watchdog_Example.ino,
examples/XPowersLibInterface_Example/XPowersLibInterface_Example.ino,
]

env:
BOARD: ${{ matrix.board }}
EXAMPLES: ${{matrix.examples}}

steps:
- uses: actions/checkout@v3

- name: Install Arduino Ci
run: |
if [[ "$BOARD" =~ "esp32:esp32:" ]]; then
wget https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Linux_64bit.tar.gz -O arduino-cli.tar.gz ;
sudo tar xf arduino-cli.tar.gz -C /usr/local/bin arduino-cli ;
arduino-cli config init ;
arduino-cli config add board_manager.additional_urls https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json ;
arduino-cli core update-index ;
arduino-cli core install esp32:esp32 ;
fi
- name: Build examples
run: |
cd $GITHUB_WORKSPACE ;
if [[ "$BOARD" =~ "esp32:esp32:" ]]; then
arduino-cli compile -besp32:esp32:esp32s3 --library . --build-property build.extra_flags=-DXPOWERS_NO_ERROR $PWD/$EXAMPLES ;
fi ;
22 changes: 17 additions & 5 deletions .github/workflows/pio.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
name: PlatformIO CI

on: [push,pull_request]
on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
example: [examples/AXP192_Example/AXP192_Example.ino,examples/AXP202_Example/AXP202_Example.ino,examples/AXP2101_Charge_Example/AXP2101_Charge_Example.ino,examples/AXP2101_Example/AXP2101_Example.ino,examples/AXP2101_InterruptExample/AXP2101_InterruptExample.ino,examples/AXP2101_Voltage_Example/AXP2101_Voltage_Example.ino,examples/XPowersLibInterface_Example/XPowersLibInterface_Example.ino,examples/AXP2101_ADC_Example/AXP2101_ADC_Example.ino,examples/AXP2101_Sleep_Example/AXP2101_Sleep_Example.ino,examples/SY6970_Example/SY6970_Example.ino,examples/SY6970_Watchdog_Example/SY6970_Watchdog_Example.ino]
example:
[
examples/AXP192_Example/AXP192_Example.ino,
examples/AXP202_Example/AXP202_Example.ino,
examples/AXP2101_ADC_Example/AXP2101_ADC_Example.ino,
examples/AXP2101_Charge_Example/AXP2101_Charge_Example.ino,
examples/AXP2101_Example/AXP2101_Example.ino,
examples/AXP2101_InterruptExample/AXP2101_InterruptExample.ino,
examples/AXP2101_Sleep_Example/AXP2101_Sleep_Example.ino,
examples/AXP2101_Voltage_Example/AXP2101_Voltage_Example.ino,
examples/SY6970_Example/SY6970_Example.ino,
examples/SY6970_Watchdog_Example/SY6970_Watchdog_Example.ino,
examples/XPowersLibInterface_Example/XPowersLibInterface_Example.ino,
]

steps:
- uses: actions/checkout@v3
Expand All @@ -20,12 +32,12 @@ jobs:
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: "3.9"
- name: Install PlatformIO Core
run: pip install --upgrade platformio

- name: Run PlatformIO
run: pio ci --lib="." --board=esp32dev --board=esp32-c3-devkitm-1
env:
PLATFORMIO_BUILD_FLAGS: -D XPOWERS_NO_ERROR
PLATFORMIO_CI_SRC: ${{ matrix.example }}
PLATFORMIO_CI_SRC: ${{ matrix.example }}

0 comments on commit e552cdd

Please sign in to comment.