From 33012716ee30e1c0acf515e4e6e32a2a81dfcfee Mon Sep 17 00:00:00 2001 From: Yakun Xu Date: Tue, 20 Apr 2021 22:30:37 +0800 Subject: [PATCH] [github-actions] download size reporter in workflow file (#6475) --- .github/workflows/size.yml | 5 +++++ script/check-size | 14 ++------------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml index 95c67cf6e..f22d9e4ac 100644 --- a/.github/workflows/size.yml +++ b/.github/workflows/size.yml @@ -56,4 +56,9 @@ jobs: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" run: | export PATH=$PATH:$HOME/.local/bin + if [ ${{ github.event_name }} == pull_request ]; then + curl -s --retry 5 "${SIZE_REPORT_URL}/bash" >size-report + chmod a+x size-report + export OT_SIZE_REPORTER=./size-report + fi ./script/check-size diff --git a/script/check-size b/script/check-size index 572c26429..775546b72 100755 --- a/script/check-size +++ b/script/check-size @@ -233,19 +233,9 @@ size_nrf52840_version() size_nrf52840() { + export OT_SHA_NEW OT_SHA_OLD - local reporter - - # not on GitHub Actions or not a pull request event - if [[ ! ${GITHUB_ACTIONS+x} || ! ${GITHUB_REF-} =~ ^refs/pull/[0-9]+/merge ]]; then - reporter=markdown - else - reporter=./size-report - curl -s --retry 5 "${SIZE_REPORT_URL}/bash" >size-report - chmod a+x size-report - export OT_SHA_NEW OT_SHA_OLD - fi - + local reporter="${OT_SIZE_REPORTER:-markdown}" "${reporter}" init OpenThread size_nrf52840_version 1.1