1# 2# Copyright (c) 2020, The OpenThread Authors. 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are met: 7# 1. Redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer. 9# 2. Redistributions in binary form must reproduce the above copyright 10# notice, this list of conditions and the following disclaimer in the 11# documentation and/or other materials provided with the distribution. 12# 3. Neither the name of the copyright holder nor the 13# names of its contributors may be used to endorse or promote products 14# derived from this software without specific prior written permission. 15# 16# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26# POSSIBILITY OF SUCH DAMAGE. 27# 28 29name: Toranj 30 31on: [push, pull_request] 32 33jobs: 34 35 cancel-previous-runs: 36 runs-on: ubuntu-20.04 37 steps: 38 - uses: rokroskar/workflow-run-cleanup-action@master 39 env: 40 GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" 41 if: "github.ref != 'refs/heads/main'" 42 43 toranj-ncp: 44 name: toranj-ncp-${{ matrix.TORANJ_RADIO }} 45 runs-on: ubuntu-18.04 46 strategy: 47 fail-fast: false 48 matrix: 49 TORANJ_RADIO: ['15.4', 'trel', 'multi'] 50 env: 51 COVERAGE: 1 52 TORANJ_RADIO : ${{ matrix.TORANJ_RADIO }} 53 steps: 54 - uses: actions/checkout@v2 55 with: 56 submodules: true 57 - name: Bootstrap 58 env: 59 GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" 60 run: | 61 sudo rm /etc/apt/sources.list.d/* && sudo apt-get update 62 sudo apt-get --no-install-recommends install -y dbus libdbus-1-dev 63 sudo apt-get --no-install-recommends install -y autoconf-archive 64 sudo apt-get --no-install-recommends install -y bsdtar 65 sudo apt-get --no-install-recommends install -y libtool 66 sudo apt-get --no-install-recommends install -y libglib2.0-dev 67 sudo apt-get --no-install-recommends install -y libboost-dev libboost-signals-dev 68 sudo apt-get --no-install-recommends install -y lcov 69 70 script/git-tool clone --depth=1 --branch=master https://github.com/openthread/wpantund.git 71 cd wpantund 72 ./bootstrap.sh 73 ./configure 74 sudo make -j2 75 sudo make install 76 - name: Build & Run 77 run: | 78 top_builddir=$(pwd)/build/toranj ./tests/toranj/start.sh 79 - name: Generate Coverage 80 if: "matrix.TORANJ_RADIO != 'multi'" 81 run: | 82 ./script/test generate_coverage gcc 83 - uses: actions/upload-artifact@v2 84 if: "matrix.TORANJ_RADIO != 'multi'" 85 with: 86 name: cov-toranj-ncp-${{ matrix.TORANJ_RADIO }} 87 path: tmp/coverage.info 88 89 toranj-cli: 90 name: toranj-cli-${{ matrix.TORANJ_RADIO }} 91 runs-on: ubuntu-18.04 92 strategy: 93 matrix: 94 TORANJ_RADIO: ['15.4'] 95 env: 96 COVERAGE: 1 97 TORANJ_RADIO : ${{ matrix.TORANJ_RADIO }} 98 TORANJ_CLI: 1 99 steps: 100 - uses: actions/checkout@v2 101 with: 102 submodules: true 103 - name: Bootstrap 104 env: 105 GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" 106 run: | 107 sudo rm /etc/apt/sources.list.d/* && sudo apt-get update 108 sudo apt-get --no-install-recommends install -y lcov 109 python3 -m pip install -r tests/scripts/thread-cert/requirements.txt 110 - name: Build & Run 111 run: | 112 top_builddir=$(pwd)/build/toranj ./tests/toranj/start.sh 113 - name: Generate Coverage 114 if: "matrix.TORANJ_RADIO != 'multi'" 115 run: | 116 ./script/test generate_coverage gcc 117 - uses: actions/upload-artifact@v2 118 if: "matrix.TORANJ_RADIO != 'multi'" 119 with: 120 name: cov-toranj-cli-${{ matrix.TORANJ_RADIO }} 121 path: tmp/coverage.info 122 123 upload-coverage: 124 needs: 125 - toranj-ncp 126 - toranj-cli 127 runs-on: ubuntu-18.04 128 steps: 129 - uses: actions/checkout@v2 130 with: 131 submodules: true 132 - name: Bootstrap 133 run: | 134 sudo apt-get --no-install-recommends install -y lcov 135 - uses: actions/download-artifact@v2 136 with: 137 path: coverage/ 138 - name: Combine Coverage 139 run: | 140 script/test combine_coverage 141 - name: Upload Coverage 142 uses: codecov/codecov-action@v2 143 with: 144 files: final.info 145 fail_ci_if_error: true 146 147 delete-coverage-artifacts: 148 needs: upload-coverage 149 runs-on: ubuntu-20.04 150 steps: 151 - uses: geekyeggo/delete-artifact@1-glob-support 152 with: 153 name: cov-* 154 useGlob: true 155