mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
122 lines
4.5 KiB
YAML
122 lines
4.5 KiB
YAML
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 }}
|