LoRa_APRS_iGate/.github/workflows/build_check.yml

109 wiersze
3.3 KiB
YAML
Czysty Zwykły widok Historia

2022-11-16 22:10:06 +00:00
name: Integration Tests
2020-06-14 21:34:13 +00:00
2022-03-26 22:26:42 +00:00
on:
2023-02-18 10:58:25 +00:00
merge_group:
2022-03-27 00:47:54 +00:00
pull_request:
2023-02-18 12:02:16 +00:00
types: [opened, reopened]
2020-06-14 21:34:13 +00:00
jobs:
2021-03-12 23:19:33 +00:00
build:
2021-05-17 08:04:05 +00:00
name: Compile Firmware
2020-08-01 08:49:56 +00:00
runs-on: ubuntu-latest
steps:
2023-02-18 11:20:44 +00:00
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
2023-02-19 11:59:32 +00:00
key: compile-cache
2023-02-18 11:20:44 +00:00
- uses: actions/setup-python@v4
with:
2023-02-19 11:59:32 +00:00
python-version: '3.10'
- name: Install PlatformIO
shell: bash
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Checkout code
uses: actions/checkout@v3
2023-02-18 11:20:44 +00:00
- name: Build PlatformIO Project
run: pio run
2021-05-15 20:19:17 +00:00
- name: Upload artifacts
2023-02-19 11:43:07 +00:00
uses: actions/upload-artifact@v3
2020-08-01 08:49:56 +00:00
with:
name: firmware
2020-12-17 21:32:01 +00:00
path: .pio/build/lora_board/firmware.bin
2021-03-13 23:18:11 +00:00
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
2021-03-13 23:51:32 +00:00
strategy:
matrix:
path:
- 'src'
- 'lib/BoardFinder'
- 'lib/ConfigurationManagement'
2021-03-13 23:54:57 +00:00
#- 'lib/Display'
#- 'lib/NTPClient'
2021-03-13 23:51:32 +00:00
- 'lib/PowerManagement'
2021-03-27 22:34:57 +00:00
- 'lib/System'
2021-03-13 23:54:57 +00:00
#- 'lib/TimeLib'
2021-03-13 23:18:11 +00:00
steps:
2021-05-15 20:19:17 +00:00
- name: Checkout code
2023-02-19 09:58:26 +00:00
uses: actions/checkout@v3
2021-03-13 23:18:11 +00:00
- name: Run clang-format style check for C/C++ programs.
2023-02-10 21:06:53 +00:00
uses: jidicula/clang-format-action@v4.10.2
2021-03-13 23:18:11 +00:00
with:
2023-02-10 21:06:53 +00:00
clang-format-version: '14'
2021-03-13 23:51:32 +00:00
check-path: ${{ matrix.path }}
2021-03-13 23:18:11 +00:00
2021-05-15 20:19:17 +00:00
cppcheck:
2021-05-17 08:28:27 +00:00
name: Run cppcheck
2021-05-15 20:19:17 +00:00
runs-on: ubuntu-latest
2021-05-17 08:28:27 +00:00
env:
2021-05-18 22:27:27 +00:00
CPPCHECK_ARGS: --enable=all --std=c++14 --inline-suppr -I lib/BoardFinder -I lib/ConfigurationManagement -I lib/Display -I lib/LoRa -I lib/LoRa_APRS -I lib/NTPClient -I lib/PowerManagement -I lib/System -I lib/TimeLib -i lib/Display -i lib/LoRa -i lib/NTPClient -i lib/TimeLib src lib
2021-05-15 20:19:17 +00:00
steps:
- name: checkout code
2023-02-19 09:58:26 +00:00
uses: actions/checkout@v3
2021-05-15 20:19:17 +00:00
- run: docker pull facthunder/cppcheck:latest
2021-05-17 08:28:27 +00:00
- name: Run cppcheck and print result
run: docker run --rm -v ${PWD}:/src facthunder/cppcheck:latest /bin/bash -c "cppcheck $CPPCHECK_ARGS"
- name: Run cppcheck and create html
run: docker run --rm -v ${PWD}:/src facthunder/cppcheck:latest /bin/bash -c "cppcheck --xml $CPPCHECK_ARGS 2> report.xml && cppcheck-htmlreport --file=report.xml --report-dir=output"
2021-05-15 20:19:17 +00:00
- name: Upload report
2023-02-19 11:43:07 +00:00
uses: actions/upload-artifact@v3
2021-05-15 20:19:17 +00:00
with:
name: Cppcheck Report
path: output
2023-02-18 11:20:44 +00:00
remote_testing:
name: Remote Testing
2023-02-19 09:48:06 +00:00
runs-on: ubuntu-20.04
2023-02-18 11:20:44 +00:00
env:
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}
steps:
2023-02-19 11:59:32 +00:00
- name: Setup Cache
2023-02-19 10:21:17 +00:00
uses: actions/cache@v3
with:
2023-02-19 11:59:32 +00:00
path: |
~/.cache/pip
~/.platformio
key: remote-cache
- name: Setup Python
2023-02-19 10:21:17 +00:00
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install PlatformIO
shell: bash
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
2023-02-18 11:20:44 +00:00
- name: Checkout code
uses: actions/checkout@v3
2023-02-19 11:38:02 +00:00
- name: List Devices
2023-02-19 10:21:17 +00:00
run: pio remote device list
2023-02-18 11:57:11 +00:00
- name: PlatformIO Test
2023-02-19 10:21:17 +00:00
run: pio remote test -v -r --upload-port /dev/ttyUSB4 --test-port /dev/ttyUSB4