Skip to content

Commit

Permalink
Enable CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
vzahradnik committed Jul 6, 2024
1 parent 1ce0d75 commit f334d6c
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 1 deletion.
78 changes: 78 additions & 0 deletions .github/workflows/platformio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: PlatformIO CI
on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
example:
- examples/abstractingPinsPCF8574/abstractingPinsPCF8574.ino
- examples/analogExample/analogExample.ino
- examples/aw9523Example/aw9523Example.ino
- examples/buttonRotaryEncoder/buttonRotaryEncoder.ino
- examples/dfRobotAnalogInSwitches/dfRobotAnalogInSwitches.ino
- examples/dfRobotRotaryEncoder/dfRobotRotaryEncoder.ino
- examples/directionOnlyEncoder/directionOnlyEncoder.ino
- examples/exampleShiftReg/exampleShiftReg.ino
- examples/i2cEepromExample/i2cEepromExample.ino
- examples/interruptSwitchEncoder8574/interruptSwitchEncoder8574.ino
- examples/ioLogging/ioLogging.ino
- examples/joystickRotaryEncoder/joystickRotaryEncoder.ino
- examples/matrixKeyboard/matrixKeyboard.ino
# MBED
# - examples/mbed/mbedExample
# - examples/mbed/mbedShiftReg
- examples/mpr121Example/mpr121Example.ino
- examples/multiIoExample/multiIoExample.ino
- examples/rotaryEncoderLed23017/rotaryEncoderLed23017.ino
# FIXME: Unknown type HardwareSPI
# - examples/spiAndExtras/spiAndExtras.ino
# STM
# - examples/stm32HalTestRom/stm32HalTestRom.cpp
- examples/timedBlink/timedBlink.ino
- examples/touchScreen/touchScreen.ino
include:
# AVR
- example: examples/avrEepromExample/avrEepromExample.ino
board: megaatmega2560
# ESP
- example: examples/arduinoEEPROMExample/arduinoEEPROMExample.ino
board: [esp32dev, esp01_1m]
- example: examples/esp32touchSwitches/esp32touchSwitches.ino
board: esp32dev
- example: examples/touchScreenFT6206Lib/touchScreenFT6206Lib.ino
board: [esp32dev, esp01_1m]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- name: Set Board Environment Variables
run: |
if [ -n "${{ matrix.board }}" ] && [ "${{ matrix.board }}" != "null" ]; then
BOARD_ENVS=""
if [ "${{ matrix.board }}" = "Array" ]; then
# If matrix.board is an array
for board in $(echo '${{ toJSON(matrix.board) }}' | jq -r '.[]'); do
BOARD_ENVS="$BOARD_ENVS --environment $board"
done
else
# If matrix.board is a single value
BOARD_ENVS="--environment ${{ matrix.board }}"
fi
echo "BOARD_ENVS=$BOARD_ENVS" >> $GITHUB_ENV
fi
shell: bash
- name: Build PlatformIO examples
run: pio ci --lib "." --project-conf=platformio.ini $BOARD_ENVS
env:
PLATFORMIO_CI_SRC: ${{ matrix.example }}
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# IoAbstraction for Arduino and mbed summary
[![PlatformIO](https://github.com/davetcc/IoAbstraction/actions/workflows/platformio.yml/badge.svg)](https://github.com/davetcc/IoAbstraction/actions/workflows/platformio.yml)
[![License: Apache 2.0](https://img.shields.io/badge/license-Apache--2.0-green.svg)](https://github.com/davetcc/IoAbstraction/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/davetcc/IoAbstraction.svg?maxAge=3600)](https://github.com/davetcc/IoAbstraction/releases)
[![davetcc](https://img.shields.io/badge/davetcc-dev-blue.svg)](https://github.com/davetcc)
[![JSC electronics](https://img.shields.io/badge/JSC-electronics-green.svg)](https://github.com/jsc-electronics)

Dave Cherry / TheCodersCorner.com made this library available for you to use. It takes me significant effort to keep all my libraries current and working on a wide range of boards. Please consider making at least a one off donation via the sponsor button if you find it useful. In forks, please keep text to here intact.

Expand Down
5 changes: 5 additions & 0 deletions examples/buttonRotaryEncoder/buttonRotaryEncoder.ino
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
#include<IoAbstraction.h>
#include <TaskManagerIO.h>

// Make sure the code builds.
#ifndef LED_BUILTIN
#define LED_BUILTIN 1
#endif

// The pin onto which we connected the rotary encoders switch
const pinid_t spinwheelClickPin = 7;

Expand Down
5 changes: 5 additions & 0 deletions examples/multiIoExample/multiIoExample.ino
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
// to make life easier, probably define each expander
#define EXPANDER1 100

// Make sure the code builds.
#ifndef LED_BUILTIN
#define LED_BUILTIN 1
#endif

// create a multi Io that allocates the first 100 pins to arduino pins
MultiIoAbstraction multiIo(EXPANDER1);
PCF8574IoAbstraction io8574(0x20, IO_PIN_NOT_DEFINED);
Expand Down
2 changes: 1 addition & 1 deletion examples/spiAndExtras/spiAndExtras.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* IoAbstraction Extras are additional analog and SPI components that are not directly in the core. You can see the
* intended way to use such a class here and build it into your own application.
*/
#include <extras/Pga2310VolumeControl.h>
#include <SPI.h>
#include <extras/Pga2310VolumeControl.h>

#define VOLUME_CS_PIN 14

Expand Down
5 changes: 5 additions & 0 deletions examples/timedBlink/timedBlink.ino
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ add.
#include<IoAbstraction.h>
#include<TaskManagerIO.h>

// Make sure the code builds.
#ifndef LED_BUILTIN
#define LED_BUILTIN 1
#endif

// constant for the pin we will use
const int ledPin = LED_BUILTIN;

Expand Down
25 changes: 25 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[env]
framework = arduino

lib_deps =
davetcc/TaskManagerIO@^1.4.3
davetcc/SimpleCollections@^1.2.3
davetcc/LiquidCrystalIO@^1.4.3
adafruit/Adafruit GFX Library@^1.11.9
adafruit/Adafruit ILI9341@^1.6.1
adafruit/Adafruit FT6206 Library@^1.1.0
adafruit/Adafruit BusIO@^1.16.1
SPI
Wire

[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560

[env:esp32dev]
platform = espressif32
board = esp32dev

[env:esp01_1m]
platform = espressif8266
board = esp01_1m

0 comments on commit f334d6c

Please sign in to comment.