From 37d467ad425f0fbe041c622febad409452fab4f9 Mon Sep 17 00:00:00 2001 From: kangping Date: Mon, 10 Oct 2022 20:26:12 +0800 Subject: [PATCH] test Android CI --- .github/workflows/android-app-build.yml | 57 ------ .github/workflows/android-app-release.yml | 2 +- .github/workflows/build.yml | 217 ---------------------- .github/workflows/tests.yml | 75 -------- 4 files changed, 1 insertion(+), 350 deletions(-) delete mode 100644 .github/workflows/android-app-build.yml delete mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/android-app-build.yml b/.github/workflows/android-app-build.yml deleted file mode 100644 index 4f9c779a2..000000000 --- a/.github/workflows/android-app-build.yml +++ /dev/null @@ -1,57 +0,0 @@ -# -# Copyright (c) 2020, The OpenThread Commissioner Authors. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -name: Android App Build - -on: [push, pull_request] - -jobs: - nightly-build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - android-api: [24] - android-abi: [x86, x86_64] - os: [macos-12, ubuntu-20.04] - steps: - - uses: actions/checkout@v2 - - name: Bootstrap - run: | - script/bootstrap.sh - - name: Build - run: | - cd android - ANDROID_ABI=${{ matrix.android-abi }} ANDROID_NDK_HOME=$(find $ANDROID_HOME/ndk -name "24.*") ./build-commissioner-libs.sh - cd openthread_commissioner - ./gradlew build - - name: Tests - uses: reactivecircus/android-emulator-runner@v2 - with: - api-level: ${{ matrix.android-api }} - arch: ${{ matrix.android-abi }} - script: "cd android/openthread_commissioner && ./gradlew connectedAndroidTest" diff --git a/.github/workflows/android-app-release.yml b/.github/workflows/android-app-release.yml index a94b18843..719920422 100644 --- a/.github/workflows/android-app-release.yml +++ b/.github/workflows/android-app-release.yml @@ -35,7 +35,7 @@ on: [push, pull_request] jobs: build-release: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - name: Check Release Version diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index ba06193d7..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,217 +0,0 @@ -# -# Copyright (c) 2020, The OpenThread Commissioner Authors. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -name: Build - -on: [push, pull_request] - -jobs: - - cancel-previous-runs: - runs-on: ubuntu-20.04 - steps: - - uses: rokroskar/workflow-run-cleanup-action@master - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - if: "github.ref != 'refs/heads/main'" - - pretty: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Bootstrap - run: | - sudo apt update - sudo apt --no-install-recommends install -y clang-format-9 - python3 -m pip install yapf==0.29.0 - - name: Check - run: | - script/make-pretty check - - gcc-build: - name: gcc-${{ matrix.gcc_ver }} - runs-on: ubuntu-20.04 - strategy: - matrix: - gcc_ver: [5, 6, 7, 8, 9, 10] - steps: - - uses: actions/checkout@v2 - - name: Install CMake 3.10.1 - run: | - wget https://cmake.org/files/v3.10/cmake-3.10.1.zip - unzip cmake-3.10.1 - cd cmake-3.10.1 - cmake . - make -j4 - sudo make install - cmake --version - - name: Bootstrap - run: | - script/bootstrap.sh - - name: Build - run: | - gcc --version - mkdir build && cd build - cmake -GNinja \ - -DBUILD_SHARED_LIBS=ON \ - -DCMAKE_CXX_STANDARD=11 \ - -DCMAKE_CXX_STANDARD_REQUIRED=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr/local \ - -DOT_COMM_WARNING_AS_ERROR=ON \ - .. - ninja - sudo ninja install - commissioner-cli -v - ./tests/commissioner-test - ./tests/commissioner-app-test - ./tests/job-manager-test - ./tests/interpreter-test - - clang-build: - name: clang-${{ matrix.clang_ver }}-${{ matrix.build_type }} - runs-on: ubuntu-20.04 - strategy: - matrix: - clang_ver: [5, 6, 7, 8, 9, 10, 11] - build_type: ["Debug", "Release"] - steps: - - uses: actions/checkout@v2 - - name: Bootstrap - run: | - script/bootstrap.sh - - name: Build - run: | - clang --version - mkdir build && cd build - cmake -GNinja \ - -DBUILD_SHARED_LIBS=ON \ - -DCMAKE_CXX_STANDARD=11 \ - -DCMAKE_CXX_STANDARD_REQUIRED=ON \ - -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ - -DCMAKE_INSTALL_PREFIX=/usr/local \ - -DOT_COMM_WARNING_AS_ERROR=ON \ - .. - ninja - sudo ninja install - commissioner-cli -v - ./tests/commissioner-test - ./tests/commissioner-app-test - ./tests/job-manager-test - ./tests/interpreter-test - - macos: - runs-on: macos-12 - steps: - - uses: actions/checkout@v2 - - name: Bootstrap - run: | - script/bootstrap.sh - - name: Build - run: | - mkdir build && cd build - cmake -G"Unix Makefiles" \ - -DCMAKE_CXX_STANDARD=11 \ - -DCMAKE_CXX_STANDARD_REQUIRED=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr/local \ - -DOT_COMM_WARNING_AS_ERROR=ON \ - .. - make -j2 - sudo make install - commissioner-cli -v - ./tests/commissioner-test - ./tests/commissioner-app-test - ./tests/job-manager-test - ./tests/interpreter-test - - android-ndk: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Bootstrap - run: | - script/bootstrap.sh - - name: Build - run: | - mkdir build && cd build - cmake -GNinja \ - -DCMAKE_TOOLCHAIN_FILE=$(find $ANDROID_HOME/ndk -name "24.*")/build/cmake/android.toolchain.cmake \ - -DANDROID_ABI="armeabi-v7a" \ - -DANDROID_ARM_NEON=ON \ - -DANDROID_NATIVE_API_LEVEL=21 \ - -DBUILD_SHARED_LIBS=ON \ - -DCMAKE_CXX_STANDARD=11 \ - -DCMAKE_CXX_STANDARD_REQUIRED=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DOT_COMM_ANDROID=ON \ - -DOT_COMM_APP=OFF \ - -DOT_COMM_TEST=OFF \ - -DOT_COMM_WARNING_AS_ERROR=ON \ - .. - ninja - - java-binding: - runs-on: macos-12 - steps: - - uses: actions/checkout@v2 - - name: Bootstrap - run: | - script/bootstrap.sh - - name: Build - run: | - mkdir build && cd build - cmake -GNinja \ - -DBUILD_SHARED_LIBS=ON \ - -DCMAKE_CXX_STANDARD=11 \ - -DCMAKE_CXX_STANDARD_REQUIRED=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DOT_COMM_JAVA_BINDING=ON \ - -DOT_COMM_WARNING_AS_ERROR=ON \ - .. - ninja - - fmt-format-check: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Bootstrap - run: | - script/bootstrap.sh - - name: Build - run: | - mkdir build && cd build - cmake -GNinja \ - -DBUILD_SHARED_LIBS=ON \ - -DCMAKE_CXX_STANDARD=14 \ - -DCMAKE_CXX_STANDARD_REQUIRED=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr/local \ - -DOT_COMM_WARNING_AS_ERROR=ON \ - .. - ninja diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 0ea57b3bb..000000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,75 +0,0 @@ -# -# Copyright (c) 2020, The OpenThread Commissioner Authors. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -name: Tests - -on: [push, pull_request] - -jobs: - integration-tests: - runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v2 - - name: Bootstrap - run: | - script/bootstrap.sh - - name: Build - run: | - mkdir build && cd build - cmake -GNinja \ - -DCMAKE_CXX_STANDARD=11 \ - -DCMAKE_CXX_STANDARD_REQUIRED=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr/local \ - -DOT_COMM_COVERAGE=ON \ - -DOT_COMM_REFERENCE_DEVICE=ON \ - -DOT_COMM_CCM=OFF \ - -DOT_COMM_WARNING_AS_ERROR=ON \ - .. - ninja - sudo ninja install - - name: Test CLI options - run: | - commissioner-cli -v - commissioner-cli -h - - name: Run unittests - run: | - ./build/tests/commissioner-test - ./build/tests/commissioner-app-test - ./build/tests/job-manager-test - ./build/tests/interpreter-test - - name: Run integration tests - run: | - cd tests/integration - ./bootstrap.sh - ./run_tests.sh - - name: Upload coverage to Codecov - run: | - lcov --directory build/ --capture --output-file coverage.info - lcov --list coverage.info - bash <(curl -s https://codecov.io/bash) -f coverage.info