LoRa_APRS_iGate/.github/workflows/build_check.yml

101 wiersze
3.1 KiB
YAML

name: push pull checks
on: [push, pull_request]
jobs:
#check:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Cache pip
# uses: actions/cache@v2
# with:
# path: ~/.cache/pip
# key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
# restore-keys: ${{ runner.os }}-pip-
# - name: Cache PlatformIO
# uses: actions/cache@v2
# with:
# path: ~/.platformio
# key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
# - name: Set up Python
# uses: actions/setup-python@v2
# - name: Install PlatformIO
# run: |
# python -m pip install --upgrade pip
# pip install --upgrade platformio
# - name: Run PlatformIO Check
# run: platformio check --fail-on-defect low --fail-on-defect medium --fail-on-defect high
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: ${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v2
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Run PlatformIO CI
run: platformio run
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: firmware
path: .pio/build/lora_board/firmware.bin
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
strategy:
matrix:
path:
- 'src'
- 'lib/BoardFinder'
- 'lib/ConfigurationManagement'
#- 'lib/Display'
#- 'lib/LoRa'
- 'lib/LoRa_APRS'
#- 'lib/NTPClient'
- 'lib/PowerManagement'
- 'lib/System'
#- 'lib/TimeLib'
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run clang-format style check for C/C++ programs.
uses: jidicula/clang-format-action@v3.2.0
with:
clang-format-version: '11'
check-path: ${{ matrix.path }}
cppcheck:
name: Run Cppcheck
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
- run: docker pull facthunder/cppcheck:latest
- name: Run Cppcheck
run: docker run --rm -v ${PWD}:/src facthunder/cppcheck:latest cppcheck -v --xml --enable=all . 2> report.xml
- name: Generate HTML report
run: docker run --rm -v ${PWD}:/src facthunder/cppcheck:latest cppcheck-htmlreport --file=report.xml --report-dir=output
- name: Upload report
uses: actions/upload-artifact@v1
with:
name: Cppcheck Report
path: output