This commit is contained in:
Dmitry Borisenko
2021-12-22 14:09:50 +01:00
parent 5e9b15e7de
commit 24a9d55ea0
195 changed files with 15629 additions and 0 deletions

View File

@@ -0,0 +1,121 @@
name: Continuous Integration
on: [push, pull_request]
jobs:
test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- name: Install
run: sudo apt-get install -y lcov
- name: Checkout
uses: actions/checkout@v2
- name: Configure
run: cmake -DCOVERAGE=true .
- name: Build
run: cmake --build .
- name: Run tests
run: ctest --output-on-failure .
- name: Capture coverage data
run: lcov --capture --no-external --directory . --output-file coverage.info
- name: Filter coverage data
run: lcov --remove coverage.info "$(pwd)/extras/*" --output-file coverage_filtered.info
- name: Generate coverage report
run: mkdir coverage && genhtml coverage_filtered.info -o coverage -t ArduinoJson
- name: Upload coverage report
uses: actions/upload-artifact@v2
with:
name: coverage
path: coverage
- name: Upload to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage_filtered.info
platformio:
name: PlatformIO
needs: test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- platform: atmelavr
board: leonardo
eeprom: true
softwareserial: true
- platform: espressif8266
board: huzzah
eeprom: true
softwareserial: true
- platform: espressif32
board: esp32dev
eeprom: true
softwareserial: false
- platform: atmelsam
board: mkr1000USB
eeprom: false
softwareserial: false
- platform: teensy
board: teensy31
eeprom: true
softwareserial: true
- platform: ststm32
board: nucleo_f031k6
eeprom: true
softwareserial: true
- platform: nordicnrf52
board: adafruit_feather_nrf52840
eeprom: false
softwareserial: true
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up cache
uses: actions/cache@v2
with:
path: |
~/.platformio
~/.cache/pip
key: ${{ runner.os }}-platformio
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install PlatformIO
run: pip install platformio
- name: Install platform "${{ matrix.platform }}"
run: platformio platform install ${{ matrix.platform }}
- name: Install adafruit-nrfutil
if: ${{ matrix.platform == 'nordicnrf52' }}
run: pip3 install adafruit-nrfutil
- name: Include Adafruit_TinyUSB.h # https://github.com/adafruit/Adafruit_nRF52_Arduino/issues/653
if: ${{ matrix.platform == 'nordicnrf52' }}
run: find examples/ -name '*.ino' -exec sed -i 's/\(#include <StreamUtils.h>\)/\1\n#include <Adafruit_TinyUSB.h>/' {} +
- name: Build EepromRead
if: ${{ matrix.eeprom }}
run: platformio ci "examples/EepromRead/EepromRead.ino" -l '.' -b ${{ matrix.board }}
- name: Build EepromWrite
if: ${{ matrix.eeprom }}
run: platformio ci "examples/EepromWrite/EepromWrite.ino" -l '.' -b ${{ matrix.board }}
- name: Build HammingSerial1
run: platformio ci "examples/HammingSerial1/HammingSerial1.ino" -l '.' -b ${{ matrix.board }}
- name: Build HammingSoftwareSerial
if: ${{ matrix.softwareserial }}
run: platformio ci "examples/HammingSoftwareSerial/HammingSoftwareSerial.ino" -l '.' -b ${{ matrix.board }}
- name: Build Logger
run: platformio ci "examples/Logger/Logger.ino" -l '.' -b ${{ matrix.board }}
- name: Build ReadBuffer
run: platformio ci "examples/ReadBuffer/ReadBuffer.ino" -l '.' -b ${{ matrix.board }}
- name: Build ReadLogger
run: platformio ci "examples/ReadLogger/ReadLogger.ino" -l '.' -b ${{ matrix.board }}
- name: Build StringPrint
run: platformio ci "examples/StringPrint/StringPrint.ino" -l '.' -b ${{ matrix.board }}
- name: Build StringStream
run: platformio ci "examples/StringStream/StringStream.ino" -l '.' -b ${{ matrix.board }}
- name: Build WriteBuffer
run: platformio ci "examples/WriteBuffer/WriteBuffer.ino" -l '.' -b ${{ matrix.board }}
- name: Build WriteLogger
run: platformio ci "examples/WriteLogger/WriteLogger.ino" -l '.' -b ${{ matrix.board }}