summaryrefslogtreecommitdiffstats
path: root/.github/workflows/selftests.yml
blob: d83f85b88df022edfb240ac832509cdce96a1d5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Selftests

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        include:
         - KERNEL_VERSION: 6.1.9
           KERNEL_PATCH_VERSION: 200.fc37
           DID_UNSHARE: 0
         - KERNEL_VERSION: 5.16.8
           KERNEL_PATCH_VERSION: 200.fc35
           DID_UNSHARE: 0
         - KERNEL_VERSION: 5.11.0
           KERNEL_PATCH_VERSION: 156.fc34
           DID_UNSHARE: 1
         - KERNEL_VERSION: 5.6.19
           KERNEL_PATCH_VERSION: 300.fc32
           DID_UNSHARE: 1
      fail-fast: false

    env:
      KERNEL_VERSION: ${{ matrix.KERNEL_VERSION }}
      KERNEL_PATCH_VERSION: ${{ matrix.KERNEL_PATCH_VERSION }}
      DID_UNSHARE: ${{ matrix.DID_UNSHARE }}
      CLANG: clang-11
      LLC: llc-11

    steps:
      - name: Check out repository code
        uses: actions/checkout@v2
        with:
          submodules: recursive
      - name: Prepare packages
        run: |
          sudo apt-get update
          sudo apt-get install zstd binutils-dev elfutils libpcap-dev libelf-dev gcc-multilib pkg-config wireshark tshark bpfcc-tools python3 python3-pip python3-setuptools qemu-kvm rpm2cpio libdw-dev libdwarf-dev
      - name: Prepare Clang
        run: |
          wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
          echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main" | sudo tee -a /etc/apt/sources.list
          sudo apt-get -qq update
          sudo apt-get -qq -y install clang-11 lld-11 llvm-11
      - name: Install latest bpftool
        run: |
          git clone --depth=1 --recurse-submodules https://github.com/libbpf/bpftool bpftool
          make LLVM_STRIP=llvm-strip-11 -C bpftool/src
          sudo make install -C bpftool/src prefix=/usr
      - name: Compile
        run: make
      - name: Prepare test tools
        run: .github/scripts/prepare_test_tools.sh
      - name: Prepare test kernel
        run: .github/scripts/prepare_test_kernel.sh
      - name: Run tests
        run: .github/scripts/run_tests_in_vm.sh