From 7c4e07414afb990e52cc4f6afade215a98ec657a Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Fri, 3 May 2024 13:55:26 +0300 Subject: [PATCH] .github/workflows: Add a GitHub action to run regression tests upon push Introduce a new GitHub action that automatically runs the scripts/run_regression_tests script upon each push to the master branch. --- .github/workflows/run_regression_tests.yaml | 66 +++++++++++++++++++++ scripts/kernel-functions | 5 ++ scripts/run-regression-tests | 4 +- 3 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/run_regression_tests.yaml diff --git a/.github/workflows/run_regression_tests.yaml b/.github/workflows/run_regression_tests.yaml new file mode 100644 index 000000000..60f2580fb --- /dev/null +++ b/.github/workflows/run_regression_tests.yaml @@ -0,0 +1,66 @@ +name: Regression tests upon push + +on: + push: + branches: + - master + +jobs: + regression_tests: + name: ${{matrix.version}} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + version: [ + '6.8.7', + '6.7.12', + '6.6.28', + '6.1.87', + '5.15.156', + '5.10.215', + '5.4.274', + '4.19.312', + '4.14.336', + '4.9.337', + '3.18.140', + '3.10.108', + '5.14.0-284.30.1.el9_2^AlmaLinux^9.2', + '4.18.0-513.24.1.el8_9^AlmaLinux^8.9', + '4.18.0-477.13.1.el8_8^AlmaLinux^8.8', + '3.10.0-1160.108.1.el7^CentOS^7.9.2009', + '5.15.0-205.149.5.1.el9uek^UEK^9', + '5.4.17-2136.330.7.1.el8uek^UEK^8', + '5.4.17-2102.206.1.el7uek^UEK^7', + '4.1.12-124.48.6.el6uek^UEK^6' + ] + steps: + - name: Checkout code + uses: actions/checkout@main + + - name: Install libelf-dev + run: | + sudo apt-get install -y libelf-dev + + - name: Install sparse + run: | + sudo apt-get install sparse + + - name: Install smatch + run: | + git clone https://github.com/error27/smatch.git + cd smatch + make -j + sudo BINDIR=/bin SHAREDIR=/home/runner/share make install + + - name: Run regression tests + run: | + err=0 + + ./scripts/run-regression-tests -l -q -k -d /tmp/scst-${{matrix.version}} ${{matrix.version}}-nc-ns-nm | tee output.txt + + cat output.txt | grep -A1 "Compiling the patched kernel" | grep -e "FAILED" -e "[^0] errors" > /dev/null 2>&1 && err=1 + + rm -f output.txt + + exit $err diff --git a/scripts/kernel-functions b/scripts/kernel-functions index 336baf8e2..21d904e5f 100644 --- a/scripts/kernel-functions +++ b/scripts/kernel-functions @@ -60,7 +60,9 @@ function download_kernel { [12].*) series="${series:0:3}";; *) series="${series/.*/}.x";; esac + mkdir -p "${kernel_downloads}" || return $? + test -w "${kernel_downloads}" || return $? ( cd "${kernel_downloads}" || return $? @@ -826,6 +828,9 @@ function download_and_extract_distro_rpm { local kver=$1 local distro=$2 local release=$3 + + mkdir -p "${kernel_downloads}" || return $? + ( cd "${kernel_downloads}" || exit $? read -a urls -r <<<"$(get_srpm_urls "$distro" "$release" x86_64 | diff --git a/scripts/run-regression-tests b/scripts/run-regression-tests index 764e9d757..4d761f1f0 100755 --- a/scripts/run-regression-tests +++ b/scripts/run-regression-tests @@ -466,9 +466,9 @@ function run_smatch { then local errors warnings errors=$(grep -c ' error:' "${outputfile}") - warnings=$(grep -c ' warning:' "${outputfile}") + warnings=$(grep -c ' warn:' "${outputfile}") echo "${errors} errors / ${warnings} warnings." - grep -E ' info:| warning:| error:' < "${outputfile}" | + grep -E ' info:| warn:| error:' < "${outputfile}" | sed 's/^\([^:]*\):[0-9:]* /\1: /;s/\((see line \)[0-9]*\()\)/\1...\2/' | sort | uniq -c