mirror of
https://github.com/espressif/openthread.git
synced 2026-11-04 05:23:14 +00:00
[github-actions] move network dependencies to Bootstrap and add retry (#13776)
Move remaining external downloads, git clones/fetches, pip installs, and Docker image builds from Build/Run steps into Bootstrap across workflows, and wrap all Bootstrap steps with script/retry to mitigate transient network flakes.
This commit is contained in:
+55
-12
@@ -59,6 +59,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y shellcheck iwyu
|
||||
@@ -83,14 +84,35 @@ jobs:
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Run linkspector
|
||||
uses: umbrelladocs/action-linkspector@6c637d70424624231467a4ca918be54fa3b792d0 # v1.5.4
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
|
||||
with:
|
||||
node-version: 24
|
||||
package-manager-cache: false
|
||||
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
env:
|
||||
PUPPETEER_EXECUTABLE_PATH: /usr/bin/google-chrome
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
reporter: github-pr-review
|
||||
fail_on_error: true
|
||||
run: |
|
||||
npm install -g @umbrelladocs/[email protected]
|
||||
wget --timeout=30 --tries=4 -O /tmp/reviewdog.tar.gz https://github.com/reviewdog/reviewdog/releases/download/v0.21.0/reviewdog_0.21.0_Linux_x86_64.tar.gz
|
||||
sudo tar -xzf /tmp/reviewdog.tar.gz -C /usr/local/bin reviewdog
|
||||
rm -f /tmp/reviewdog.tar.gz
|
||||
|
||||
- name: Run linkspector
|
||||
env:
|
||||
PUPPETEER_EXECUTABLE_PATH: /usr/bin/google-chrome
|
||||
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set +o pipefail
|
||||
linkspector check -c .linkspector.yml -j |
|
||||
reviewdog -f=rdjson \
|
||||
-name=Linkspector \
|
||||
-reporter=github-pr-review \
|
||||
-filter-mode=added \
|
||||
-fail-level=any \
|
||||
-level=error
|
||||
|
||||
cmake-presets:
|
||||
runs-on: ubuntu-24.04
|
||||
@@ -105,7 +127,9 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y build-essential ninja-build libreadline-dev libncurses-dev
|
||||
- name: Build
|
||||
run: |
|
||||
@@ -126,7 +150,9 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y build-essential ninja-build libreadline-dev libncurses-dev
|
||||
- name: Build and test with platform-specific options enabled
|
||||
run: |
|
||||
@@ -148,10 +174,13 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y build-essential ninja-build libreadline-dev libncurses-dev
|
||||
sudo apt-get remove cmake
|
||||
sudo apt-get purge --auto-remove cmake
|
||||
sudo apt-get remove -y cmake || true
|
||||
sudo apt-get purge -y --auto-remove cmake || true
|
||||
rm -rf cmake-3.10.3*
|
||||
wget --timeout=30 --tries=4 http://www.cmake.org/files/v3.10/cmake-3.10.3.tar.gz
|
||||
tar xf cmake-3.10.3.tar.gz
|
||||
cd cmake-3.10.3
|
||||
@@ -190,6 +219,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y ninja-build libreadline-dev libncurses-dev
|
||||
@@ -211,6 +241,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y clang-tools-14 ninja-build
|
||||
@@ -232,7 +263,9 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y ninja-build libreadline-dev libncurses-dev
|
||||
cd third_party/mbedtls/repo && git fetch --tags && git checkout tags/v2.28.8
|
||||
- name: Build
|
||||
@@ -288,12 +321,16 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
env:
|
||||
PR_BODY: "${{ github.event.pull_request.body }}"
|
||||
run: |
|
||||
cd /tmp
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y build-essential lib32z1 ninja-build gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
|
||||
wget --timeout=30 --tries 4 --no-verbose ${{ matrix.gcc_download_url }} -O gcc-arm
|
||||
tar xf gcc-arm
|
||||
rm -rf /tmp/gcc-arm /tmp/${{ matrix.gcc_extract_dir }}
|
||||
wget --timeout=30 --tries 4 --no-verbose ${{ matrix.gcc_download_url }} -O /tmp/gcc-arm
|
||||
tar xf /tmp/gcc-arm -C /tmp
|
||||
script/check-arm-build setup
|
||||
- name: Build
|
||||
env:
|
||||
PR_BODY: "${{ github.event.pull_request.body }}"
|
||||
@@ -324,6 +361,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
case ${{ matrix.gcc_ver }} in
|
||||
@@ -369,7 +407,9 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
rm -f llvm.sh
|
||||
wget --timeout=30 --tries=4 https://apt.llvm.org/llvm.sh
|
||||
chmod +x llvm.sh
|
||||
sudo ./llvm.sh ${{ matrix.clang_ver }}
|
||||
@@ -403,6 +443,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y ninja-build gn
|
||||
@@ -438,10 +479,12 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
brew update
|
||||
rm -f ninja-mac.zip /usr/local/bin/ninja
|
||||
wget --timeout=30 --tries 4 https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-mac.zip
|
||||
unzip ninja-mac.zip && mv ninja /usr/local/bin/.
|
||||
unzip -o ninja-mac.zip && mv ninja /usr/local/bin/.
|
||||
- name: Build
|
||||
run: |
|
||||
case ${{ matrix.target }} in
|
||||
|
||||
@@ -64,6 +64,7 @@ jobs:
|
||||
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo add-apt-repository -y ppa:wireshark-dev/stable
|
||||
sudo apt-get update
|
||||
@@ -98,6 +99,7 @@ jobs:
|
||||
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
env:
|
||||
PR_BODY: "${{ github.event.pull_request.body }}"
|
||||
run: |
|
||||
@@ -136,6 +138,7 @@ jobs:
|
||||
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
env:
|
||||
PR_BODY: "${{ github.event.pull_request.body }}"
|
||||
run: |
|
||||
@@ -170,6 +173,7 @@ jobs:
|
||||
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y ninja-build libgrpc++-dev libprotobuf-dev protobuf-compiler-grpc
|
||||
@@ -202,6 +206,7 @@ jobs:
|
||||
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y ninja-build
|
||||
|
||||
@@ -64,29 +64,37 @@ jobs:
|
||||
submodules: recursive
|
||||
persist-credentials: false
|
||||
|
||||
- name: Clone ot-br-posix and replace openthread submodule
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
|
||||
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 15
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
OPENTHREAD_DIR=$(pwd)
|
||||
docker rm -f otbr-dind >/dev/null 2>&1 || true
|
||||
sudo rm -rf /tmp/ot-br-posix
|
||||
./script/git-tool clone https://github.com/openthread/ot-br-posix.git --depth 1 --recurse-submodules --shallow-submodules /tmp/ot-br-posix
|
||||
cd /tmp/ot-br-posix
|
||||
rm -rf third_party/openthread/repo
|
||||
mkdir -p third_party/openthread/repo
|
||||
rsync -r --exclude=.git --exclude=build --exclude=ot_testing "${OPENTHREAD_DIR}/." third_party/openthread/repo
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
|
||||
|
||||
- name: Build DinD Runner Image
|
||||
run: |
|
||||
cd /tmp/ot-br-posix
|
||||
docker build -t otbr-dind-runner -f etc/docker/test/Dockerfile.dind_runner .
|
||||
|
||||
- name: Run DinD Integration Test
|
||||
run: |
|
||||
cd /tmp/ot-br-posix
|
||||
docker run --privileged --rm \
|
||||
docker rm -f otbr-dind >/dev/null 2>&1 || true
|
||||
docker run -d --privileged --name otbr-dind \
|
||||
-v /tmp/ot-br-posix:/usr/src/ot-br-posix \
|
||||
-w /usr/src/ot-br-posix \
|
||||
-e DOCKER_HOST=unix:///var/run/docker.sock \
|
||||
otbr-dind-runner \
|
||||
bash -c "dockerd --host=unix:///var/run/docker.sock >/dev/null 2>&1 & ./tests/scripts/test_dind_dns_sd.sh ${{ matrix.mdns }}"
|
||||
sh -c "dockerd --host=unix:///var/run/docker.sock >/dev/null 2>&1"
|
||||
if grep -q -- '--setup-only' tests/scripts/test_dind_dns_sd.sh; then
|
||||
docker exec otbr-dind ./tests/scripts/test_dind_dns_sd.sh --setup-only ${{ matrix.mdns }}
|
||||
fi
|
||||
|
||||
- name: Run DinD Integration Test
|
||||
run: |
|
||||
if grep -q -- '--run-only' /tmp/ot-br-posix/tests/scripts/test_dind_dns_sd.sh; then
|
||||
docker exec otbr-dind ./tests/scripts/test_dind_dns_sd.sh --run-only ${{ matrix.mdns }}
|
||||
else
|
||||
docker exec otbr-dind ./tests/scripts/test_dind_dns_sd.sh ${{ matrix.mdns }}
|
||||
fi
|
||||
|
||||
+10
-10
@@ -94,28 +94,26 @@ jobs:
|
||||
if: ${{ matrix.use_core_firewall }}
|
||||
run: |
|
||||
echo "FIREWALL=0" >> $GITHUB_ENV
|
||||
- name: Build OTBR Docker
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 15
|
||||
shell: bash ./script/retry {0}
|
||||
env:
|
||||
PR_BODY: "${{ github.event.pull_request.body }}"
|
||||
TREL: ${{ matrix.otbr_trel }}
|
||||
run: |
|
||||
./script/test build_otbr_docker
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
run: |
|
||||
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo rm -f /etc/apt/sources.list.d/* && sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y python3-setuptools python3-wheel ninja-build lcov
|
||||
sudo bash script/install_socat
|
||||
python3 -m pip install -r tests/scripts/thread-cert/requirements.txt
|
||||
./script/test build_otbr_docker
|
||||
./script/test get_thread_wireshark
|
||||
curl -fsSL https://codecov.io/env -o /tmp/codecov_env.sh
|
||||
- name: Build
|
||||
run: |
|
||||
./script/test build
|
||||
- name: Get Thread-Wireshark
|
||||
run: |
|
||||
./script/test get_thread_wireshark
|
||||
- name: Run
|
||||
run: |
|
||||
export CI_ENV="$(bash <(curl -s https://codecov.io/env)) -e GITHUB_ACTIONS -e COVERAGE"
|
||||
export CI_ENV="$(bash /tmp/codecov_env.sh) -e GITHUB_ACTIONS -e COVERAGE"
|
||||
echo "CI_ENV=${CI_ENV}"
|
||||
sudo -E ./script/test cert_suite ${{ matrix.cert_scripts }} || (sudo chmod a+r ot_testing/* && false)
|
||||
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
@@ -153,7 +151,9 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y lcov
|
||||
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
|
||||
@@ -72,11 +72,13 @@ jobs:
|
||||
cache: pip
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y ninja-build
|
||||
python3 -m pip install -r tests/scripts/thread-cert/requirements.txt
|
||||
python3 -m pip install pytype adb-shell
|
||||
(cd tools/otci && python3 -m pip install . && rm -rf build ./*.egg-info)
|
||||
- name: Style check
|
||||
run: |
|
||||
PYTHONPATH=./tests/scripts/thread-cert pytype tools/otci
|
||||
@@ -84,9 +86,6 @@ jobs:
|
||||
run: |
|
||||
./script/cmake-build simulation -DOT_THREAD_VERSION=1.4 -DOT_MLR=ON -DOT_BACKBONE_ROUTER=ON \
|
||||
-DOT_CSL_RECEIVER=ON -DOT_SIMULATION_VIRTUAL_TIME=${VIRTUAL_TIME}
|
||||
- name: Install OTCI Python Library
|
||||
run: |
|
||||
(cd tools/otci && python3 -m pip install .)
|
||||
- name: Run
|
||||
run: |
|
||||
export PYTHONPATH=./tests/scripts/thread-cert/
|
||||
|
||||
@@ -75,13 +75,23 @@ jobs:
|
||||
python-version: "3.9"
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y lcov ninja-build
|
||||
rm -rf /tmp/otns
|
||||
./script/git-tool clone --depth 1 https://github.com/openthread/ot-ns.git /tmp/otns
|
||||
cp README.md /tmp/otns/openthread/README.md
|
||||
(
|
||||
cd /tmp/otns
|
||||
./script/install-deps
|
||||
. .venv-otns/bin/activate
|
||||
python3 -m pip install -r pylibs/unittests/requirements.txt
|
||||
./script/install
|
||||
)
|
||||
- name: Run
|
||||
run: |
|
||||
export OT_DIR=$PWD
|
||||
./script/git-tool clone --depth 1 https://github.com/openthread/ot-ns.git /tmp/otns
|
||||
(
|
||||
cd /tmp/otns
|
||||
./script/test py-unittests
|
||||
@@ -119,13 +129,21 @@ jobs:
|
||||
python-version: "3.9"
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y lcov ninja-build
|
||||
rm -rf /tmp/otns
|
||||
./script/git-tool clone --depth 1 https://github.com/openthread/ot-ns.git /tmp/otns
|
||||
cp README.md /tmp/otns/openthread/README.md
|
||||
(
|
||||
cd /tmp/otns
|
||||
./script/install-deps
|
||||
./script/install
|
||||
)
|
||||
- name: Run
|
||||
run: |
|
||||
export OT_DIR=$PWD
|
||||
./script/git-tool clone --depth 1 https://github.com/openthread/ot-ns.git /tmp/otns
|
||||
(
|
||||
cd /tmp/otns
|
||||
./script/test py-examples
|
||||
@@ -185,13 +203,21 @@ jobs:
|
||||
python-version: "3.9"
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y lcov ninja-build
|
||||
rm -rf /tmp/otns
|
||||
./script/git-tool clone --depth 1 https://github.com/openthread/ot-ns.git /tmp/otns
|
||||
cp README.md /tmp/otns/openthread/README.md
|
||||
(
|
||||
cd /tmp/otns
|
||||
./script/install-deps
|
||||
./script/install
|
||||
)
|
||||
- name: Run
|
||||
run: |
|
||||
export OT_DIR=$PWD
|
||||
./script/git-tool clone --depth 1 https://github.com/openthread/ot-ns.git /tmp/otns
|
||||
(
|
||||
cd /tmp/otns
|
||||
./script/test stress-tests ${{ matrix.suite }}
|
||||
@@ -230,7 +256,9 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y lcov
|
||||
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
|
||||
@@ -78,8 +78,10 @@ jobs:
|
||||
cache: pip
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get --no-install-recommends install -y expect ninja-build lcov
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y bind9-host expect lcov ninja-build ntp
|
||||
sudo bash script/install_socat
|
||||
pip install bleak 'cryptography==43.0.0'
|
||||
- name: Run RCP Mode
|
||||
@@ -108,10 +110,7 @@ jobs:
|
||||
- name: Run TUN Mode
|
||||
if: matrix.category == 'tun'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
echo 0 | sudo tee /proc/sys/net/ipv6/conf/all/disable_ipv6
|
||||
sudo apt-get install --no-install-recommends -y bind9-host ntp
|
||||
sudo bash script/install_socat
|
||||
sudo systemctl restart ntp
|
||||
sudo socat 'UDP6-LISTEN:53,fork,reuseaddr,bind=[::1]' UDP:127.0.0.53:53 &
|
||||
socat 'TCP6-LISTEN:2000,fork,reuseaddr' TCP:127.0.0.53:53 &
|
||||
@@ -169,12 +168,14 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y expect lcov libreadline-dev net-tools ninja-build
|
||||
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
|
||||
sudo bash script/install_socat
|
||||
cd /tmp
|
||||
rm -rf bsd-licensed.tar.gz libcoap-bsd-licensed
|
||||
wget --timeout=30 --tries=4 https://github.com/obgm/libcoap/archive/bsd-licensed.tar.gz
|
||||
tar xvf bsd-licensed.tar.gz
|
||||
cd libcoap-bsd-licensed
|
||||
@@ -218,6 +219,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y net-tools ninja-build
|
||||
@@ -251,6 +253,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
rm -f /usr/local/bin/2to3
|
||||
rm -f /usr/local/bin/2to3-3.11
|
||||
@@ -286,9 +289,11 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
env:
|
||||
PR_BODY: "${{ github.event.pull_request.body }}"
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y expect ninja-build lcov
|
||||
sudo bash script/install_socat
|
||||
sudo python3 -m pip install git+https://github.com/openthread/pyspinel
|
||||
@@ -324,7 +329,9 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y lcov
|
||||
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
|
||||
@@ -63,16 +63,19 @@ jobs:
|
||||
cache: pip
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
env:
|
||||
PR_BODY: "${{ github.event.pull_request.body }}"
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y avahi-daemon avahi-utils lcov
|
||||
sudo apt-get install -y --no-install-recommends dbus avahi-daemon avahi-utils expect lcov
|
||||
rm -rf /tmp/ot-commissioner
|
||||
script/git-tool clone https://github.com/openthread/ot-commissioner.git /tmp/ot-commissioner --depth 1 --branch main
|
||||
/tmp/ot-commissioner/script/bootstrap.sh
|
||||
pip install --user -r /tmp/ot-commissioner/tools/commissioner_thci/requirements.txt
|
||||
- name: Build
|
||||
run: |
|
||||
cd /tmp/ot-commissioner
|
||||
script/bootstrap.sh
|
||||
cmake -GNinja \
|
||||
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
|
||||
-DCMAKE_CXX_STANDARD=11 \
|
||||
@@ -84,11 +87,20 @@ jobs:
|
||||
-S . -B build
|
||||
cmake --build build
|
||||
sudo cmake --install build
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
OT_CMAKE_NINJA_TARGET="package" OT_CMAKE_BUILD_DIR="build/package/openthread-sim" ./script/cmake-build simulation -DOT_COVERAGE=ON
|
||||
OT_CMAKE_NINJA_TARGET="package" OT_CMAKE_BUILD_DIR="build/package/openthread-daemon" ./script/cmake-build posix -DOT_DAEMON=ON -DOT_PLATFORM_NETIF=ON -DOT_PLATFORM_UDP=ON -DOT_COVERAGE=ON
|
||||
sudo dpkg -i build/package/openthread-sim/openthread-simulation-*.deb
|
||||
sudo dpkg -i build/package/openthread-daemon/openthread-daemon-*.deb
|
||||
mkdir -p /tmp/test-ot-commissioner
|
||||
ln -sf "$(which ot-ctl)" /tmp/test-ot-commissioner/ot-ctl
|
||||
ln -sf "$(which ot-daemon)" /tmp/test-ot-commissioner/ot-daemon
|
||||
ln -sf "$(which ot-rcp)" /tmp/test-ot-commissioner/ot-rcp-non-ccm
|
||||
ln -sf "$(which ot-cli-ftd)" /tmp/test-ot-commissioner/ot-cli-ftd-non-ccm
|
||||
- name: Run
|
||||
run: |
|
||||
export OT_COMM_OPENTHREAD="$(pwd)"
|
||||
cd /tmp/ot-commissioner/tests/integration
|
||||
./bootstrap.sh
|
||||
./run_tests.sh
|
||||
- name: Generate Coverage
|
||||
run: |
|
||||
@@ -115,7 +127,9 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y expect ninja-build lcov
|
||||
- name: Run
|
||||
run: |
|
||||
@@ -154,6 +168,7 @@ jobs:
|
||||
cache: pip
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y g++-multilib lcov ninja-build
|
||||
@@ -206,7 +221,9 @@ jobs:
|
||||
cache: pip
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y expect ninja-build lcov
|
||||
sudo bash script/install_socat
|
||||
pip install bleak 'cryptography==43.0.0'
|
||||
@@ -255,7 +272,9 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y lcov
|
||||
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
|
||||
@@ -56,12 +56,19 @@ jobs:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
env:
|
||||
PR_BODY: "${{ github.event.pull_request.body }}"
|
||||
run: |
|
||||
./script/check-size setup
|
||||
- name: Run
|
||||
env:
|
||||
PR_BODY: "${{ github.event.pull_request.body }}"
|
||||
PR_NUMBER: "${{ github.event.pull_request.number }}"
|
||||
run: |
|
||||
./script/check-size
|
||||
./script/check-size nrf52840
|
||||
cat /tmp/ot-size-report/report_pr >> $GITHUB_STEP_SUMMARY
|
||||
- name: Upload report
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
@@ -73,10 +73,12 @@ jobs:
|
||||
cache: pip
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y ninja-build lcov
|
||||
python3 -m pip install -r tests/scripts/thread-cert/requirements.txt
|
||||
./tests/toranj/start.sh bootstrap
|
||||
- name: Build & Run
|
||||
run: |
|
||||
top_builddir=$(pwd)/build/toranj ./tests/toranj/start.sh
|
||||
@@ -108,10 +110,12 @@ jobs:
|
||||
cache: pip
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y ninja-build lcov
|
||||
python3 -m pip install -r tests/scripts/thread-cert/requirements.txt
|
||||
./tests/toranj/start.sh bootstrap
|
||||
- name: Build & Run
|
||||
run: |
|
||||
top_builddir=$(pwd)/build/toranj ./tests/toranj/start.sh
|
||||
@@ -141,6 +145,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y ninja-build
|
||||
@@ -168,6 +173,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y ninja-build
|
||||
@@ -194,6 +200,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y ninja-build
|
||||
@@ -220,6 +227,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y ninja-build
|
||||
@@ -248,6 +256,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y ninja-build
|
||||
@@ -270,6 +279,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
brew update
|
||||
brew install ninja
|
||||
@@ -293,7 +303,9 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y lcov
|
||||
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
|
||||
@@ -78,6 +78,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y ninja-build lcov libgtest-dev libgmock-dev
|
||||
@@ -122,7 +123,9 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Bootstrap
|
||||
timeout-minutes: 10
|
||||
shell: bash ./script/retry {0}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y lcov
|
||||
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
|
||||
@@ -35,6 +35,12 @@ readonly OT_TMP_DIR
|
||||
OT_SHA_NEW=${GITHUB_SHA:-$(git rev-parse HEAD)}
|
||||
readonly OT_SHA_NEW
|
||||
|
||||
build_setup()
|
||||
{
|
||||
rm -rf "${OT_TMP_DIR}"
|
||||
script/git-tool clone https://github.com/openthread/ot-nrf528xx.git "${OT_TMP_DIR}"
|
||||
}
|
||||
|
||||
build_nrf52840()
|
||||
{
|
||||
local options=(
|
||||
@@ -78,9 +84,10 @@ build_nrf52840()
|
||||
"-DOT_UPTIME=ON"
|
||||
)
|
||||
|
||||
rm -rf "${OT_TMP_DIR}"
|
||||
if [[ ! -d "${OT_TMP_DIR}/.git" ]]; then
|
||||
build_setup
|
||||
fi
|
||||
|
||||
script/git-tool clone https://github.com/openthread/ot-nrf528xx.git "${OT_TMP_DIR}"
|
||||
rm -rf "${OT_TMP_DIR}/openthread/*"
|
||||
git archive "${OT_SHA_NEW}" | tar x -C "${OT_TMP_DIR}/openthread"
|
||||
|
||||
|
||||
+27
-6
@@ -46,10 +46,10 @@ readonly OT_REPORT_FILE_PR
|
||||
|
||||
PR_NUMBER="${PR_NUMBER:-}"
|
||||
|
||||
export PATH=/var/tmp/gcc-arm-none-eabi-7-2018-q2-update/bin:$PATH
|
||||
|
||||
setup_arm_gcc_7()
|
||||
{
|
||||
export PATH=/var/tmp/gcc-arm-none-eabi-7-2018-q2-update/bin:$PATH
|
||||
|
||||
if arm-none-eabi-gcc --version | grep -q 'Arm Embedded Processors 7'; then
|
||||
return 0
|
||||
fi
|
||||
@@ -59,6 +59,7 @@ setup_arm_gcc_7()
|
||||
local stage
|
||||
stage="$(mktemp -d /var/tmp/.ot-arm-gcc7.XXXXXX)"
|
||||
trap 'rm -rf "${stage:-}"' EXIT
|
||||
rm -rf /var/tmp/gcc-arm-none-eabi-7-2018-q2-update
|
||||
if wget --tries 4 --no-verbose -O "${stage}/toolchain.tar.bz2" "${toolchain_url}" \
|
||||
&& echo "${toolchain_sha256} ${stage}/toolchain.tar.bz2" | sha256sum -c - \
|
||||
&& tar xj -C /var/tmp -f "${stage}/toolchain.tar.bz2"; then
|
||||
@@ -74,13 +75,28 @@ setup_arm_gcc_7()
|
||||
|
||||
setup_ninja_build()
|
||||
{
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y ninja-build
|
||||
}
|
||||
|
||||
setup_repos()
|
||||
{
|
||||
rm -rf "${OT_TMP_DIR}"
|
||||
mkdir -p "${OT_TMP_DIR}"
|
||||
|
||||
if [[ "${GITHUB_ACTIONS+x}" ]] && [[ -n ${OT_SHA_OLD} ]] && ! git cat-file -e "${OT_SHA_OLD}^{commit}" 2>/dev/null; then
|
||||
git fetch --depth 1 --no-recurse-submodules origin "${OT_SHA_OLD}"
|
||||
fi
|
||||
|
||||
script/git-tool clone https://github.com/openthread/ot-nrf528xx.git "${OT_TMP_DIR}/ot-nrf528xx-new"
|
||||
script/git-tool clone no-depend https://github.com/openthread/ot-nrf528xx.git "${OT_TMP_DIR}/ot-nrf528xx-old"
|
||||
}
|
||||
|
||||
setup()
|
||||
{
|
||||
setup_arm_gcc_7
|
||||
setup_ninja_build
|
||||
setup_repos
|
||||
}
|
||||
|
||||
nm_size()
|
||||
@@ -131,8 +147,13 @@ build_nrf52840()
|
||||
local config_name="ot-core-config-check-size-$1.h"
|
||||
local config_file="../examples/config/${config_name}"
|
||||
|
||||
mkdir -p "${OT_TMP_DIR}/${folder}"
|
||||
script/git-tool "${clone_options[@]}" https://github.com/openthread/ot-nrf528xx.git "${OT_TMP_DIR}/${folder}"
|
||||
rm -rf "${OT_TMP_DIR:?}/${folder}"
|
||||
if [[ -d "${OT_TMP_DIR}/ot-nrf528xx-$2/.git" ]]; then
|
||||
cp -a "${OT_TMP_DIR}/ot-nrf528xx-$2" "${OT_TMP_DIR}/${folder}"
|
||||
else
|
||||
mkdir -p "${OT_TMP_DIR}/${folder}"
|
||||
script/git-tool "${clone_options[@]}" https://github.com/openthread/ot-nrf528xx.git "${OT_TMP_DIR}/${folder}"
|
||||
fi
|
||||
rm -rf "${OT_TMP_DIR}/${folder}/openthread/*" # replace openthread submodule with latest commit
|
||||
git archive "${sha}" | tar x -C "${OT_TMP_DIR}/${folder}/openthread"
|
||||
|
||||
@@ -305,10 +326,10 @@ size_nrf52840()
|
||||
{
|
||||
export OT_SHA_NEW OT_SHA_OLD
|
||||
|
||||
rm -rf "${OT_TMP_DIR}"
|
||||
mkdir -p "${OT_TMP_DIR}"
|
||||
rm -rf "${OT_REPORT_FILE_TABLE}" "${OT_REPORT_FILE_TABLE}_libs" "${OT_REPORT_FILE_PR}" "${OT_REPORT_FILE_PR}_libs"
|
||||
|
||||
if [[ "${GITHUB_ACTIONS+x}" ]]; then
|
||||
if [[ "${GITHUB_ACTIONS+x}" ]] && [[ -n ${OT_SHA_OLD} ]] && ! git cat-file -e "${OT_SHA_OLD}^{commit}" 2>/dev/null; then
|
||||
git fetch --depth 1 --no-recurse-submodules origin "${OT_SHA_OLD}"
|
||||
fi
|
||||
|
||||
|
||||
Executable
+84
@@ -0,0 +1,84 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2026, The OpenThread 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.
|
||||
#
|
||||
# Description:
|
||||
# Retry a command or GitHub Actions step script on failure.
|
||||
#
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
main()
|
||||
{
|
||||
local max_attempts="${OT_RETRY_ATTEMPTS:-3}"
|
||||
local delay_seconds="${OT_RETRY_DELAY:-10}"
|
||||
local attempt=1
|
||||
local exit_code=0
|
||||
local -a cmd
|
||||
|
||||
if [[ $# -eq 0 ]]; then
|
||||
echo "Usage: $0 <command> [args...]" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ $# -ge 1 && -f $1 && ! -x $1 ]]; then
|
||||
cmd=(bash --noprofile --norc -e -o pipefail "$@")
|
||||
else
|
||||
cmd=("$@")
|
||||
fi
|
||||
|
||||
if [[ -n ${GITHUB_ACTIONS:-} && -d /etc/apt/apt.conf.d ]] && command -v sudo >/dev/null 2>&1; then
|
||||
sudo tee /etc/apt/apt.conf.d/zzz-ot-timeout >/dev/null <<'EOF' || true
|
||||
Acquire::Retries "1";
|
||||
Acquire::http::Timeout "10";
|
||||
Acquire::https::Timeout "10";
|
||||
EOF
|
||||
if [[ -f /etc/apt/apt-mirrors.txt ]]; then
|
||||
sudo sed -i 's|^\(http://azure\.archive\.ubuntu\.com/.*\)\tpriority:1$|\1\tpriority:4|' /etc/apt/apt-mirrors.txt || true
|
||||
fi
|
||||
fi
|
||||
|
||||
while true; do
|
||||
exit_code=0
|
||||
"${cmd[@]}" || exit_code=$?
|
||||
|
||||
if [[ ${exit_code} -eq 0 ]]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ ${attempt} -ge ${max_attempts} ]]; then
|
||||
echo "Command failed after ${attempt} attempts (exit code ${exit_code}): ${cmd[*]}" >&2
|
||||
return "${exit_code}"
|
||||
fi
|
||||
|
||||
echo "Attempt ${attempt}/${max_attempts} failed (exit code ${exit_code}). Retrying in ${delay_seconds}s..." >&2
|
||||
sleep "${delay_seconds}"
|
||||
attempt=$((attempt + 1))
|
||||
done
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -89,6 +89,7 @@ install_wpantund()
|
||||
sudo apt-get update
|
||||
sudo apt-get --no-install-recommends install -y libboost-all-dev python2
|
||||
|
||||
rm -rf wpantund
|
||||
git clone --depth=1 --branch=master https://github.com/openthread/wpantund.git || die "wpandtund clone"
|
||||
cd wpantund || die "cd wpantund failed"
|
||||
./bootstrap.sh
|
||||
@@ -107,7 +108,9 @@ if [ "$TORANJ_NCP" = 1 ]; then
|
||||
if [ "$TORANJ_EVENT_NAME" = "pull_request" ]; then
|
||||
cd ../..
|
||||
OT_SHA_OLD="$(git cat-file -p HEAD | grep 'parent ' | head -n1 | cut -d' ' -f2)"
|
||||
git fetch --depth 1 --no-recurse-submodules origin "${OT_SHA_OLD}"
|
||||
if [ -n "${OT_SHA_OLD}" ] && ! git cat-file -e "${OT_SHA_OLD}^{commit}" 2>/dev/null; then
|
||||
git fetch --depth 1 --no-recurse-submodules origin "${OT_SHA_OLD}" || die "git fetch failed"
|
||||
fi
|
||||
if git diff --name-only --exit-code "${OT_SHA_OLD}" -- src/ncp; then
|
||||
echo "No changes to any of src/ncp files - skip running tests."
|
||||
echo "========================================================================"
|
||||
@@ -118,7 +121,11 @@ if [ "$TORANJ_NCP" = 1 ]; then
|
||||
fi
|
||||
|
||||
echo "========================================================================"
|
||||
install_wpantund
|
||||
command -v wpantund >/dev/null 2>&1 || install_wpantund
|
||||
fi
|
||||
|
||||
if [ "${1:-}" = "bootstrap" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -z "${top_builddir}" ]; then
|
||||
|
||||
Reference in New Issue
Block a user