fixup gh #230
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- '**' | |
#pull_request: | |
# branches: | |
# - master | |
jobs: | |
tests: | |
runs-on: ${{ matrix.runs_on }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- displayTargetName: ubuntu-22.04 | |
os: unix | |
runs_on: ubuntu-22.04 | |
shell: bash | |
defconfig: defconfig | |
testname: um-mmu | |
- displayTargetName: ubuntu-22.04 (nommu) | |
os: unix | |
runs_on: ubuntu-22.04 | |
shell: bash | |
defconfig: x86_64_nommu_defconfig | |
kunit_opts: --kconfig_add CONFIG_MMU=n | |
testname: um-nommu | |
timeout-minutes: 100 | |
env: | |
CCACHE_DIR: ${{ github.workspace }}/.ccache | |
USE_CCACHE: 1 | |
defaults: | |
run: | |
shell: ${{ matrix.shell }} | |
steps: | |
- name: Set env | |
shell: bash | |
run: | | |
echo "/usr/lib/ccache/bin:/usr/lib/ccache:${{ github.workspace }}/bin" >> $GITHUB_PATH | |
echo "export PATH=/usr/lib/ccache/bin:/usr/lib/ccache:${{ github.workspace }}/bin:$PATH" >> $HOME/.bashrc | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: ${{ env.CCACHE_DIR }} | |
key: ${{ runner.os }}-${{ matrix.defconfig }}-ccache-build-${{ github.sha }} | |
restore-keys: ${{ runner.os }}-${{ matrix.defconfig }}-ccache-build- | |
- name: Install packages | |
run: | | |
sudo apt update -y | |
sudo apt install -y ccache libseccomp-dev | |
- name: Setup faketty | |
uses: Yuri6037/Action-FakeTTY@v1.1 | |
- name: build-0 | |
run: | | |
make ARCH=um ${{ matrix.defconfig }} O=build | |
make -j8 ARCH=um O=build | |
- name: Log in to docker.io | |
uses: docker/login-action@v3.2.0 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: image for test | |
run: | | |
container_id=$(docker create kollerr/alpine-test:latest) | |
#container_id=$(docker create alpine:latest) | |
docker export $container_id > alpine.tar | |
docker rm $container_id | |
mnt=$(mktemp -d) | |
dd if=/dev/zero of=alpine.ext4 bs=1 count=0 seek=1G | |
sudo chmod og+wr "alpine.ext4" | |
yes 2>/dev/null | mkfs.ext4 "alpine.ext4" || true | |
sudo mount "alpine.ext4" $mnt | |
sudo tar -xf alpine.tar -C $mnt | |
sudo mknod -m 666 $mnt/dev/null c 1 3 | |
sudo mknod -m 666 $mnt/dev/zero c 1 5 | |
sudo mknod -m 666 $mnt/dev/ptmx c 5 2 | |
sudo mknod -m 666 $mnt/dev/tty c 5 0 | |
sudo mknod -m 444 $mnt/dev/random c 1 8 | |
sudo mknod -m 444 $mnt/dev/urandom c 1 9 | |
sudo cp .github/workflows/busybox $mnt/bin/busybox | |
echo "/sbin/halt" >> .github/workflows/rcS | |
sudo cp .github/workflows/rcS $mnt/etc/init.d/ | |
sudo cp .github/workflows/inittab $mnt/etc/ | |
cat .github/workflows/bench.sh | sed "s/time //" > /tmp/bench.sh | |
sudo cp /tmp/bench.sh $mnt/ | |
sudo cp .github/workflows/do_getpid.alpine $mnt/root/do_getpid | |
sudo umount $mnt | |
- name: test-0 | |
run: | | |
sudo sh -c "echo 0 > /proc/sys/vm/mmap_min_addr" | |
sudo ip tuntap add dev tap100 mode tap user | |
faketty ./build/vmlinux eth0=tuntap,tap100,0e:fd:0:0:0:1,172.17.0.1 ubd0=./alpine.ext4 rw mem=1024m loglevel=8 console=tty init=/sbin/init 2>&1 | tee /tmp/log.txt | |
echo "=========" | |
cat /tmp/log.txt | |
- name: kunit test | |
run: | | |
for config in `find ./ -name .kunitconfig | grep -v -E "kfence|sunrpc|handshake|kcsan|gpu" `; do \ | |
echo "==" $config "==" ; \ | |
./tools/testing/kunit/kunit.py run --kunitconfig=$config ${{ matrix.kunit_opts }} | |
done | |
- name: build-1 | |
run: | | |
make ARCH=um ${{ matrix.defconfig }} | |
make -j8 ARCH=um | |
- name: test-1 | |
run: | | |
faketty ./vmlinux eth0=tuntap,tap100,0e:fd:0:0:0:1,172.17.0.1 ubd0=./alpine.ext4 rw mem=1024m loglevel=8 init=/sbin/init 2>&1 | tee /tmp/log.txt | |
echo "=========" | |
cat /tmp/log.txt | |
- name: benchmark-0 | |
run: | | |
mkdir -p output | |
faketty ./vmlinux eth0=tuntap,tap100,0e:fd:0:0:0:1,172.17.0.1 ubd0=./alpine.ext4 rw mem=1024m \ | |
loglevel=0 console=tty init=/bench.sh | tee output/${{ matrix.testname }}.dat | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: bench-result | |
path: output/${{ matrix.testname }}.dat | |
- name: Setup tmate session | |
uses: mxschmitt/action-tmate@v3 | |
with: | |
detached: true | |
checkpatch: | |
runs-on: ubuntu-22.04 | |
name: checkpatch | |
steps: | |
- name: Checkout | |
with: | |
fetch-depth: 0 | |
uses: actions/checkout@v4 | |
- name: Install pip dependencies | |
run: sudo pip install ply GitPython | |
#- name: Setup tmate session | |
# uses: mxschmitt/action-tmate@v3 | |
# with: | |
# detached: true | |
- name: Check coding style | |
run: | | |
git checkout -b tmp | |
git format-patch -o p1 v6.10..HEAD~1 | |
./scripts/checkpatch.pl --summary-file --ignore FILE_PATH_CHANGES p1/*.patch | |
bench-result: | |
runs-on: ubuntu-22.04 | |
name: bench-result | |
needs: tests | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
- name: Display structure of downloaded files | |
run: ls -R | |
- name: Install packages | |
run: | | |
sudo apt update -y | |
sudo apt install -y gnuplot lmbench | |
- name: benchmark-host | |
run: | | |
mkdir -p output | |
sh .github/workflows/lmbench_run.sh |& tee output/native.dat | |
.github/workflows/do_getpid -c 100 | tee -a output/native.dat | |
- name: bench data parse/out | |
run: | | |
bash .github/workflows/um-nommu-plot.sh output |