From 7e464849f6b4c67d352f891df8db9f7fbe48a019 Mon Sep 17 00:00:00 2001 From: David Vernet Date: Wed, 3 Jan 2024 13:47:24 -0600 Subject: [PATCH] scx: Test CI Let's add a CI action which verifies that we can build the kernel, and run the tests in tools/testing/selftests/scx, on pushes and PRs. Signed-off-by: David Vernet --- .github/workflows/build-run.yml | 48 ++++++++++++++++++ tools/testing/selftests/scx/run.sh | 61 ----------------------- tools/testing/selftests/scx/test_sched.sh | 49 ++++++++++++++++++ 3 files changed, 97 insertions(+), 61 deletions(-) create mode 100644 .github/workflows/build-run.yml delete mode 100755 tools/testing/selftests/scx/run.sh create mode 100755 tools/testing/selftests/scx/test_sched.sh diff --git a/.github/workflows/build-run.yml b/.github/workflows/build-run.yml new file mode 100644 index 0000000000000..73566db863faf --- /dev/null +++ b/.github/workflows/build-run.yml @@ -0,0 +1,48 @@ +name: build-run +run-name: ${{ github.actor }} PR run +on: [pull_request, push] +jobs: + build-run-schedulers: + runs-on: ubuntu-22.04 + steps: + ### OTHER REPOS #### + + # Hard turn-off interactive mode + - run: echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections + + # Refresh packages list + - run: sudo apt update + + ### DOWNLOAD AND INSTALL DEPENDENCIES ### + + # Download dependencies packaged by Ubuntu + - run: sudo apt -y install coreutils cmake cargo elfutils libelf-dev libunwind-dev libzstd-dev linux-headers-generic linux-tools-common linux-tools-generic ninja-build python3-pip python3-requests qemu-kvm udev iproute2 busybox-static libvirt-clients kbd kmod file pahole rsync zstd + + # clang 17 + # Use a custom llvm.sh script which includes the -y flag for + # add-apt-repository. Otherwise, the CI job will hang. If and when + # https://github.com/opencollab/llvm-jenkins.debian.net/pull/26 is + # merged, we can go back to using https://apt.llvm.org/llvm.sh. + - run: wget https://raw.githubusercontent.com/Decave/llvm-jenkins.debian.net/fix_llvmsh/llvm.sh + - run: chmod +x llvm.sh + - run: sudo ./llvm.sh all + - run: sudo ln -sf /usr/bin/clang-17 /usr/bin/clang + - run: sudo ln -sf /usr/bin/llvm-strip-17 /usr/bin/llvm-strip + + # bpftool + - run: git clone --recurse-submodules --branch v7.3.0 https://github.com/libbpf/bpftool.git + - run: make -j -C bpftool/src + - run: sudo make -j -C bpftool/src install + + - uses: actions/checkout@v4 + + ### END DEPENDENCIES ### + + # The actual build: + - run: make CC=clang LD=ld.lld olddefconfig + - run: cat tools/testing/selftests/scx/config | xargs ./scripts/config -e + - run: make CC=clang LD=ld.lld -j$(nproc) + + # Test schedulers + - run: make CC=clang Ld=ld.lld -C tools/testing/selftests/scx -j$(nproc) + - run: ./tools/testing/selftests/scx/test_sched.sh ./vmlinux diff --git a/tools/testing/selftests/scx/run.sh b/tools/testing/selftests/scx/run.sh deleted file mode 100755 index 5824464e0b05a..0000000000000 --- a/tools/testing/selftests/scx/run.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-2.0 -# Please run as root - -# Kselftest framework requirement - SKIP code is 4. -ksft_skip=4 - -count_pass=0 -count_fail=0 -count_skip=0 -exitcode=0 - -usage() { - cat <&1