From cc79be035a4afc01ee3f307d74ec5d1b243543ec Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 3 Dec 2022 17:57:37 +0100 Subject: [PATCH 1/5] busybox: Add the file at the right place --- .github/workflows/CICD.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index fbd94093d87..ad8b107a88e 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -772,12 +772,14 @@ jobs: - name: "Run BusyBox test suite" shell: bash run: | + cp .busybox-config target/debug/.config ## Run BusyBox test suite bindir=$(pwd)/target/debug cd tmp/busybox-*/testsuite output=$(bindir=$bindir ./runtest 2>&1 || true) printf "%s\n" "${output}" n_fails=$(echo "$output" | grep "^FAIL:\s" | wc --lines) + echo "n_fails $n_fails" if [ $n_fails -gt 0 ] ; then echo "::warning ::${n_fails}+ test failures" ; fi test_android: From 92942722a72ce0c6511b2af72cbf6d3bd326396d Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 4 Dec 2022 16:40:03 +0100 Subject: [PATCH 2/5] bump busybox --- GNUmakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index 28f6c5d823f..d47b4f38da6 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -38,7 +38,7 @@ PKG_BUILDDIR := $(BUILDDIR)/deps DOCSDIR := $(BASEDIR)/docs BUSYBOX_ROOT := $(BASEDIR)/tmp -BUSYBOX_VER := 1.32.1 +BUSYBOX_VER := 1.35.0 BUSYBOX_SRC := $(BUSYBOX_ROOT)/busybox-$(BUSYBOX_VER) ifeq ($(SELINUX_ENABLED),) From 9ab9ec7fc502fb468d54452c06aa75784e4e8999 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 4 Dec 2022 17:19:44 +0100 Subject: [PATCH 3/5] extract and store busybox results --- .github/workflows/CICD.yml | 52 +++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index ad8b107a88e..66f56c7f41c 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -758,6 +758,12 @@ jobs: job: - { os: ubuntu-latest } steps: + - name: Initialize workflow variables + id: vars + shell: bash + run: | + ## VARs setup + echo "TEST_SUMMARY_FILE=busybox-result.json" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 - name: Install/setup prerequisites shell: bash @@ -768,19 +774,59 @@ jobs: run: | rustup toolchain install stable --profile minimal rustup default stable + - name: Install dependencies + shell: bash + run: | + ## Install dependencies + sudo apt-get update + sudo apt-get install jq - uses: Swatinem/rust-cache@v2 - name: "Run BusyBox test suite" + id: summary shell: bash run: | + set -v cp .busybox-config target/debug/.config ## Run BusyBox test suite bindir=$(pwd)/target/debug cd tmp/busybox-*/testsuite output=$(bindir=$bindir ./runtest 2>&1 || true) printf "%s\n" "${output}" - n_fails=$(echo "$output" | grep "^FAIL:\s" | wc --lines) - echo "n_fails $n_fails" - if [ $n_fails -gt 0 ] ; then echo "::warning ::${n_fails}+ test failures" ; fi + FAIL=$(echo "$output" | grep "^FAIL:\s" | wc --lines) + PASS=$(echo "$output" | grep "^PASS:\s" | wc --lines) + SKIPPED=$(echo "$output" | grep "^SKIPPED:\s" | wc --lines) + TOTAL=`expr $FAIL + $PASS + $SKIPPED` + echo "FAIL $FAIL" + echo "SKIP $SKIPPED" + echo "PASS $PASS" + echo "TOTAL $TOTAL" + cd - + jq -n \ + --arg date "$(date --rfc-email)" \ + --arg sha "$GITHUB_SHA" \ + --arg total "$TOTAL" \ + --arg pass "$PASS" \ + --arg skip "$SKIPPED" \ + --arg fail "$FAIL" \ + '{($date): { sha: $sha, total: $total, pass: $pass, skip: $skip, fail: $fail, }}' > '${{ steps.vars.outputs.TEST_SUMMARY_FILE }}' + HASH=$(sha1sum '${{ steps.vars.outputs.TEST_SUMMARY_FILE }}' | cut --delim=" " -f 1) + echo "HASH=${HASH}" >> $GITHUB_OUTPUT + if [ $FAIL -gt 0 ] ; then echo "::warning ::${FAIL}+ test failures" ; fi + - name: Reserve SHA1/ID of 'test-summary' + uses: actions/upload-artifact@v3 + with: + name: "${{ steps.summary.outputs.HASH }}" + path: "${{ steps.vars.outputs.TEST_SUMMARY_FILE }}" + - name: Reserve test results summary + uses: actions/upload-artifact@v3 + with: + name: test-summary + path: "${{ steps.vars.outputs.TEST_SUMMARY_FILE }}" + - name: Upload json results + uses: actions/upload-artifact@v3 + with: + name: busybox-result.json + path: ${{ steps.vars.outputs.TEST_SUMMARY_FILE }} test_android: name: Test Android builds From c432c7723300bed254622133df58b0b587b44c45 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 4 Dec 2022 22:44:31 +0100 Subject: [PATCH 4/5] move the cache earlier --- .github/workflows/CICD.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 66f56c7f41c..6a178a4b091 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -765,22 +765,12 @@ jobs: ## VARs setup echo "TEST_SUMMARY_FILE=busybox-result.json" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 - name: Install/setup prerequisites shell: bash run: | ## Install/setup prerequisites make prepare-busytest - - name: Install `rust` toolchain - run: | - rustup toolchain install stable --profile minimal - rustup default stable - - name: Install dependencies - shell: bash - run: | - ## Install dependencies - sudo apt-get update - sudo apt-get install jq - - uses: Swatinem/rust-cache@v2 - name: "Run BusyBox test suite" id: summary shell: bash From 2efda01c377f1b4ea83620738a512694838c9a70 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 5 Dec 2022 08:47:55 +0100 Subject: [PATCH 5/5] busybox: remove the warning in the CI --- .github/workflows/CICD.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 6a178a4b091..a51d3fdcbfe 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -801,7 +801,6 @@ jobs: '{($date): { sha: $sha, total: $total, pass: $pass, skip: $skip, fail: $fail, }}' > '${{ steps.vars.outputs.TEST_SUMMARY_FILE }}' HASH=$(sha1sum '${{ steps.vars.outputs.TEST_SUMMARY_FILE }}' | cut --delim=" " -f 1) echo "HASH=${HASH}" >> $GITHUB_OUTPUT - if [ $FAIL -gt 0 ] ; then echo "::warning ::${FAIL}+ test failures" ; fi - name: Reserve SHA1/ID of 'test-summary' uses: actions/upload-artifact@v3 with: