| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381 |
- name: Continuous Integration
- on: [push, pull_request]
- jobs:
- clang-format:
- name: Clang-Format
- runs-on: ubuntu-20.04
- steps:
- - name: Install
- run: sudo apt-get install -y clang-format
- - name: Checkout
- uses: actions/checkout@v2
- - name: Format
- run: find src/ extras/ -name '*.[ch]pp' | xargs clang-format -i --verbose --style=file
- - name: Diff
- run: git diff --exit-code
- gcc:
- name: GCC
- needs: clang-format
- runs-on: ubuntu-20.04
- strategy:
- fail-fast: false
- matrix:
- include:
- - gcc: "4.4"
- - gcc: "4.6"
- - gcc: "4.7"
- - gcc: "4.8"
- - gcc: "4.9"
- - gcc: "5"
- - gcc: "6"
- - gcc: "7"
- cxxflags: -fsanitize=leak -fno-sanitize-recover=all
- - gcc: "8"
- cxxflags: -fsanitize=undefined -fno-sanitize-recover=all
- - gcc: "9"
- cxxflags: -fsanitize=address -fno-sanitize-recover=all
- - gcc: "10"
- steps:
- - name: Install
- run: |
- sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ trusty main'
- sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ trusty universe'
- sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ xenial main'
- sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ xenial universe'
- sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ bionic main'
- sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ bionic universe'
- sudo apt-get update
- sudo apt-get install -y gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }}
- - name: Checkout
- uses: actions/checkout@v2
- - name: Configure
- run: cmake -DCMAKE_BUILD_TYPE=Debug .
- env:
- CC: gcc-${{ matrix.gcc }}
- CXX: g++-${{ matrix.gcc }}
- CXXFLAGS: ${{ matrix.cxxflags }}
- - name: Build
- run: cmake --build .
- - name: Test
- run: ctest --output-on-failure -C Debug .
- env:
- UBSAN_OPTIONS: print_stacktrace=1
- clang:
- name: Clang
- needs: clang-format
- runs-on: ubuntu-20.04
- strategy:
- fail-fast: false
- matrix:
- include:
- - clang: "3.5"
- cxxflags: "-stdlib=libc++"
- - clang: "3.6"
- cxxflags: "-stdlib=libc++"
- - clang: "3.7"
- cxxflags: "-stdlib=libc++"
- - clang: "3.8"
- cxxflags: "-stdlib=libc++"
- - clang: "3.9"
- cxxflags: "-stdlib=libc++"
- - clang: "4.0"
- cxxflags: "-stdlib=libc++"
- - clang: "5.0"
- - clang: "6.0"
- - clang: "7"
- - clang: "8"
- cxxflags: -fsanitize=leak -fno-sanitize-recover=all
- - clang: "9"
- cxxflags: -fsanitize=undefined -fno-sanitize-recover=all
- - clang: "10"
- cxxflags: -fsanitize=address -fno-sanitize-recover=all
- steps:
- - name: Install
- run: |
- sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ trusty main'
- sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ trusty universe'
- sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ xenial main'
- sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ xenial universe'
- sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ bionic main'
- sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ bionic universe'
- sudo apt-get update
- sudo apt-get install -y clang-${{ matrix.clang }}
- - name: Checkout
- uses: actions/checkout@v2
- - name: Configure
- run: cmake -DCMAKE_BUILD_TYPE=Debug .
- env:
- CC: clang-${{ matrix.clang }}
- CXX: clang++-${{ matrix.clang }}
- CXXFLAGS: >-
- ${{ matrix.cxxflags }}
- ${{ contains(matrix.cxxflags, 'libc++') && '-I/usr/lib/llvm-10/include/c++/v1/' || '' }}
- - name: Build
- run: cmake --build .
- - name: Test
- run: ctest --output-on-failure -C Debug .
- env:
- UBSAN_OPTIONS: print_stacktrace=1
- xcode:
- name: XCode
- needs: clang
- runs-on: macos-10.15
- strategy:
- fail-fast: false
- matrix:
- include:
- - xcode: "10.3"
- - xcode: "11.7"
- - xcode: "12.4"
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Select XCode version
- run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app
- - name: Configure
- run: cmake -DCMAKE_BUILD_TYPE=Debug .
- - name: Build
- run: cmake --build .
- - name: Test
- run: ctest --output-on-failure -C Debug .
- # DISABLED: Running on AppVeyor instead because it supports older versions of the compiler
- # msvc:
- # name: Visual Studio
- # strategy:
- # fail-fast: false
- # matrix:
- # include:
- # - os: windows-2016
- # - os: windows-2019
- # runs-on: ${{ matrix.os }}
- # steps:
- # - name: Checkout
- # uses: actions/checkout@v2
- # - name: Configure
- # run: cmake -DCMAKE_BUILD_TYPE=Debug .
- # - name: Build
- # run: cmake --build .
- # - name: Test
- # run: ctest --output-on-failure -C Debug .
- arduino:
- name: Arduino
- needs: gcc
- strategy:
- fail-fast: false
- matrix:
- include:
- - arduino: "1.6.7"
- os: ubuntu-18.04 # java.lang.Error: Cannot load com.sun.java.swing.plaf.gtk.GTKLookAndFeel
- board: arduino:avr:uno
- - arduino: "1.8.2"
- board: arduino:samd:mkr1000
- runs-on: ${{ matrix.os || 'ubuntu-latest' }}
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Build
- run: extras/ci/arduino.sh ${{ matrix.board }}
- env:
- BOARD: ${{ matrix.board }}
- VERSION: ${{ matrix.arduino }}
- platformio:
- name: PlatformIO
- needs: gcc
- runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- include:
- - platform: atmelavr
- board: leonardo
- libraries:
- - SD
- - Ethernet
- - platform: espressif8266
- board: huzzah
- - platform: espressif32
- board: esp32dev
- libraries:
- - Ethernet
- - platform: atmelsam
- board: mkr1000USB
- libraries:
- - SD
- - Ethernet
- - platform: teensy
- board: teensy31
- - platform: ststm32
- board: adafruit_feather_f405
- libraries:
- - SD
- - Ethernet
- - platform: nordicnrf52
- board: adafruit_feather_nrf52840
- libraries:
- - SD
- - Ethernet
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Set up cache for pip
- uses: actions/cache@v2
- with:
- path: ~/.cache/pip
- key: ${{ runner.os }}-pip
- - 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 adafruit-nrfutil
- if: ${{ matrix.platform == 'nordicnrf52' }}
- run: pip install adafruit-nrfutil
- - name: Set up cache for platformio
- uses: actions/cache@v2
- with:
- path: ~/.platformio
- key: ${{ runner.os }}-platformio-${{ matrix.platform }}
- - name: Install platform "${{ matrix.platform }}"
- run: platformio platform install ${{ matrix.platform }}
- - name: Install libraries
- if: ${{ matrix.libraries }}
- run: platformio lib install arduino-libraries/${{ join(matrix.libraries, ' arduino-libraries/') }}
- - name: Build JsonConfigFile
- run: platformio ci "examples/JsonConfigFile/JsonConfigFile.ino" -l '.' -b ${{ matrix.board }}
- - name: Build JsonFilterExample
- run: platformio ci "examples/JsonFilterExample/JsonFilterExample.ino" -l '.' -b ${{ matrix.board }}
- - name: Build JsonGeneratorExample
- run: platformio ci "examples/JsonGeneratorExample/JsonGeneratorExample.ino" -l '.' -b ${{ matrix.board }}
- - name: Build JsonHttpClient
- run: platformio ci "examples/JsonHttpClient/JsonHttpClient.ino" -l '.' -b ${{ matrix.board }}
- - name: Build JsonParserExample
- run: platformio ci "examples/JsonParserExample/JsonParserExample.ino" -l '.' -b ${{ matrix.board }}
- - name: Build JsonServer
- if: ${{ matrix.platform != 'espressif32' }}
- run: platformio ci "examples/JsonServer/JsonServer.ino" -l '.' -b ${{ matrix.board }}
- - name: Build JsonUdpBeacon
- run: platformio ci "examples/JsonUdpBeacon/JsonUdpBeacon.ino" -l '.' -b ${{ matrix.board }}
- - name: Build MsgPackParser
- run: platformio ci "examples/MsgPackParser/MsgPackParser.ino" -l '.' -b ${{ matrix.board }}
- - name: Build ProgmemExample
- run: platformio ci "examples/ProgmemExample/ProgmemExample.ino" -l '.' -b ${{ matrix.board }}
- - name: Build StringExample
- run: platformio ci "examples/StringExample/StringExample.ino" -l '.' -b ${{ matrix.board }}
- - name: PlatformIO prune
- if: ${{ always() }}
- run: platformio system prune -f
- particle:
- name: Particle
- needs: gcc
- runs-on: ubuntu-latest
- if: github.event_name == 'push'
- strategy:
- fail-fast: false
- matrix:
- include:
- - board: argon
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Install Particle CLI
- run: sudo npm install -g particle-cli
- - name: Login to Particle
- run: particle login -t "${{ secrets.PARTICLE_TOKEN }}"
- - name: Compile
- run: extras/ci/particle.sh ${{ matrix.board }}
- arm:
- name: GCC for ARM processor
- needs: gcc
- runs-on: ubuntu-20.04
- steps:
- - name: Install
- run: sudo apt-get install -y g++-arm-linux-gnueabihf
- - name: Checkout
- uses: actions/checkout@v2
- - name: Configure
- run: cmake .
- env:
- CC: arm-linux-gnueabihf-gcc
- CXX: arm-linux-gnueabihf-g++
- - name: Build
- run: cmake --build .
- coverage:
- needs: gcc
- name: Coverage
- runs-on: ubuntu-20.04
- steps:
- - name: Install
- run: sudo apt-get install -y lcov ninja-build
- - name: Checkout
- uses: actions/checkout@v2
- - name: Configure
- run: cmake -G Ninja -DCOVERAGE=true .
- - name: Build
- run: ninja
- - name: Test
- run: ctest -LE 'WillFail|Fuzzing' -T test
- - name: lcov --capture
- run: lcov --capture --no-external --directory . --output-file coverage.info
- - name: lcov --remove
- run: lcov --remove coverage.info "$(pwd)/extras/*" --output-file coverage_filtered.info
- - name: genhtml
- run: mkdir coverage && genhtml coverage_filtered.info -o coverage -t ArduinoJson
- - name: Upload HTML 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
- valgrind:
- needs: gcc
- name: Valgrind
- runs-on: ubuntu-20.04
- steps:
- - name: Install
- run: sudo apt-get install -y valgrind ninja-build
- - name: Checkout
- uses: actions/checkout@v2
- - name: Configure
- run: cmake -G Ninja -D MEMORYCHECK_COMMAND_OPTIONS="--error-exitcode=1 --leak-check=full" .
- - name: Build
- run: ninja
- - name: Memcheck
- run: ctest -LE WillFail -T memcheck
- id: memcheck
- - name: MemoryChecker.*.log
- run: cat Testing/Temporary/MemoryChecker.*.log
- if: failure()
- clang-tidy:
- needs: clang
- name: Clang-Tidy
- runs-on: ubuntu-20.04
- steps:
- - name: Install
- run: sudo apt-get install -y clang-tidy cmake ninja-build
- - name: Checkout
- uses: actions/checkout@v2
- - name: Configure
- run: cmake -G Ninja -DCMAKE_CXX_CLANG_TIDY="clang-tidy-10;--warnings-as-errors=*" -DCMAKE_BUILD_TYPE=Debug .
- env:
- CC: clang-10
- CXX: clang++-10
- - name: Check
- run: cmake --build . -- -k 0
|