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: Build 30 31on: 32 push: 33 branches-ignore: 34 - 'dependabot/**' 35 pull_request: 36 branches: 37 - 'main' 38 39jobs: 40 41 cancel-previous-runs: 42 runs-on: ubuntu-20.04 43 steps: 44 - uses: rokroskar/workflow-run-cleanup-action@master 45 env: 46 GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" 47 if: "github.ref != 'refs/heads/main'" 48 49 pretty: 50 runs-on: ubuntu-20.04 51 steps: 52 - uses: actions/checkout@v2 53 - name: Bootstrap 54 run: BUILD_TARGET=pretty-check tests/scripts/bootstrap.sh 55 - name: Check 56 run: script/make-pretty check 57 58 android-check: 59 runs-on: ubuntu-20.04 60 steps: 61 - uses: actions/checkout@v2 62 with: 63 submodules: true 64 - name: Check (Border Agent with mDNSResponder) 65 run: > 66 docker run --rm --env OTBR_MDNS=mDNSResponder -v $PWD:/build/ot-br-posix -v $PWD/third_party/openthread/repo:/build/external/openthread openthread/android-trusty bash -c 67 "BUILD_TARGET=android-check ot-br-posix/tests/scripts/bootstrap.sh && \ 68 ot-br-posix/tests/scripts/check-android-build" 69 70 check: 71 runs-on: ubuntu-20.04 72 strategy: 73 fail-fast: false 74 matrix: 75 build_type: ["Debug", "Release"] 76 mdns: ["mDNSResponder", "avahi"] 77 env: 78 BUILD_TARGET: check 79 OTBR_BUILD_TYPE: ${{ matrix.build_type }} 80 OTBR_MDNS: ${{ matrix.mdns }} 81 OTBR_OPTIONS: "-DOTBR_SRP_ADVERTISING_PROXY=ON" 82 OTBR_COVERAGE: 1 83 steps: 84 - uses: actions/checkout@v2 85 with: 86 submodules: true 87 - name: Bootstrap 88 run: tests/scripts/bootstrap.sh 89 - name: Run 90 run: script/test build check 91 - name: Codecov 92 uses: codecov/codecov-action@v2 93 94 rest-check: 95 runs-on: ubuntu-18.04 96 strategy: 97 fail-fast: false 98 matrix: 99 rest: ["rest-off", ""] 100 env: 101 BUILD_TARGET: check 102 OTBR_REST: ${{ matrix.rest }} 103 OTBR_MDNS: mDNSResponder 104 OTBR_OPTIONS: "-DOTBR_SRP_ADVERTISING_PROXY=ON -DOTBR_DNSSD_DISCOVERY_PROXY=ON" 105 OTBR_COVERAGE: 1 106 steps: 107 - uses: actions/checkout@v2 108 with: 109 submodules: true 110 - name: Bootstrap 111 run: tests/scripts/bootstrap.sh 112 - name: Run 113 run: script/test build check 114 - name: Codecov 115 uses: codecov/codecov-action@v2 116 117 script-check: 118 runs-on: ubuntu-20.04 119 env: 120 BUILD_TARGET: script-check 121 OTBR_COVERAGE: 1 122 steps: 123 - uses: actions/checkout@v2 124 with: 125 submodules: true 126 - name: Bootstrap 127 run: tests/scripts/bootstrap.sh 128 - name: Run 129 run: tests/scripts/check-scripts 130 - name: Codecov 131 uses: codecov/codecov-action@v2 132 133 scan-build: 134 runs-on: ubuntu-20.04 135 env: 136 BUILD_TARGET: scan-build 137 CC: clang 138 CXX: clang++ 139 steps: 140 - uses: actions/checkout@v2 141 with: 142 submodules: true 143 - name: Bootstrap 144 run: tests/scripts/bootstrap.sh 145 - name: Run 146 run: tests/scripts/check-scan-build 147 148 package: 149 runs-on: ubuntu-18.04 150 env: 151 BUILD_TARGET: package 152 steps: 153 - uses: actions/checkout@v2 154 with: 155 submodules: true 156 - name: Bootstrap 157 run: | 158 tests/scripts/bootstrap.sh 159 sudo pip3 install --system -U cmake==3.10.3 160 cmake --version | grep 3.10.3 161 - name: Build 162 run: script/test package 163 164 simulation: 165 runs-on: ubuntu-latest 166 env: 167 BUILD_TARGET: check 168 steps: 169 - uses: actions/checkout@v2 170 with: 171 submodules: true 172 - name: Bootstrap 173 run: tests/scripts/bootstrap.sh 174 - name: Build 175 run: | 176 script/bootstrap 177 script/test build 178 - name: Run 179 run: | 180 script/test simulation 181