name: Integration Tests on: merge_group: pull_request: types: [opened, reopened] jobs: build: name: Compile Firmware runs-on: ubuntu-latest steps: - uses: actions/cache@v3 with: path: | ~/.cache/pip ~/.platformio/.cache key: compile-cache - 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 - name: Checkout code uses: actions/checkout@v3 - name: Build PlatformIO Project run: pio run - name: Upload artifacts uses: actions/upload-artifact@v3 with: name: firmware path: .pio/build/lora_board/firmware.bin - name: Upload artifacts uses: actions/upload-artifact@v3 with: name: build_folder path: .pio formatting-check: name: Formatting Check runs-on: ubuntu-latest strategy: matrix: path: - 'src' - 'lib/BoardFinder' - 'lib/ConfigurationManagement' #- 'lib/Display' #- 'lib/NTPClient' - 'lib/PowerManagement' - 'lib/System' #- 'lib/TimeLib' steps: - name: Checkout code uses: actions/checkout@v3 - name: Run clang-format style check for C/C++ programs. uses: jidicula/clang-format-action@v4.10.2 with: clang-format-version: '14' check-path: ${{ matrix.path }} cppcheck: name: Run cppcheck runs-on: ubuntu-latest env: 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 steps: - name: checkout code uses: actions/checkout@v3 - run: docker pull facthunder/cppcheck:latest - 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" - name: Upload report uses: actions/upload-artifact@v3 with: name: Cppcheck Report path: output #remote_testing: # name: Remote Testing # runs-on: ubuntu-20.04 # env: # PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }} # steps: # - name: Setup Cache # uses: actions/cache@v3 # with: # path: | # ~/.cache/pip # ~/.platformio # key: remote-cache # - name: Setup Python # 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 # # - name: Checkout code # uses: actions/checkout@v3 # - name: List Devices # run: pio remote device list # - name: PlatformIO Test # run: pio remote test -v -r --upload-port /dev/ttyUSB4 --test-port /dev/ttyUSB4 hw_testing: name: Hardware Testing runs-on: self-hosted strategy: matrix: include: - board: 'board0' port: '/dev/ttyUSB0' - board: 'board1' port: '/dev/ttyUSB1' - board: 'board2' port: '/dev/ttyUSB2' steps: - name: Install PlatformIO shell: bash run: | python -m pip install --upgrade pip pip install --upgrade platformio - name: Checkout code uses: actions/checkout@v3 - name: Download a single artifact uses: actions/download-artifact@v3 with: name: build_folder - name: PlatformIO Test run: pio test -vv --without-building --upload-port ${{ matrix.port }} --test-port ${{ matrix.port }}