Skip to content

Commit

Permalink
Merge pull request #4 from senseshift/feature/ci
Browse files Browse the repository at this point in the history
👷 (GitHub): Build examples
  • Loading branch information
leon0399 authored Jul 24, 2024
2 parents f7e4886 + 3484413 commit 5e523b9
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/arduino-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
on:
pull_request:
paths-ignore:
- "**/*.md"
push:
branches:
- master
- main
- develop
- support/*
paths-ignore:
- "**/*.md"

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: arduino/arduino-lint-action@v1
# with:
# library-manager: update

build-examples:
runs-on: ubuntu-latest

strategy:
matrix:
fqbn:
- "esp32:esp32:esp32"
- "esp32:esp32:esp32s3"
- "esp32:esp32:esp32c3"
nimble: [ false, true ]

steps:
- uses: actions/checkout@v4

- uses: arduino/compile-sketches@v1
with:
fqbn: ${{ matrix.fqbn }}
libraries: |
- source-path: ./
- name: NimBLE-Arduino
cli-compile-flags: |
- --build-property
- build.extra_flags="-DBLESERIAL_USE_NIMBLE=${{ matrix.nimble }}"
66 changes: 66 additions & 0 deletions .github/workflows/platformio-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
on:
pull_request:
paths-ignore:
- "**/*.md"
push:
branches:
- master
- main
- develop
- support/*
paths-ignore:
- "**/*.md"

jobs:
platformio:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
example:
- "SerialToSerialBLE"
boards:
- [ esp32dev, esp32-s3-devkitc-1, esp32-c3-devkitm-1 ]
nimble: [ false, true ]

steps:
- uses: actions/checkout@v4

- 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/.cache
./.pio
key: ${{ runner.os }}-pio-${{ hashFiles('**/*.ini') }}
restore-keys: |
${{ runner.os }}-pio-
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"

- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
pio upgrade --dev
pio pkg update --global
- name: Build example
run: |
pio ci --lib="." --board=${{ join(matrix.boards, ' --board=') }} ${{ matrix.nimble && '--project-option="lib_deps=h2zero/NimBLE-Arduino@^1.4.0"' || '' }}
env:
PLATFORMIO_CI_SRC: "./examples/${{ matrix.example }}/*.ino"
PLATFORMIO_BUILD_FLAGS: "-D BLESERIAL_USE_NIMBLE=${{ matrix.nimble }}"

0 comments on commit 5e523b9

Please sign in to comment.