xref: /freebsd/sys/contrib/openzfs/.github/workflows/zloop.yml (revision 6296500a85c8474e3ff3fe2f8e4a9d56dd0acd64)
1name: zloop
2
3on:
4  push:
5  pull_request:
6
7concurrency:
8  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
9  cancel-in-progress: true
10
11jobs:
12  zloop:
13    runs-on: ubuntu-24.04
14    env:
15      WORK_DIR: /mnt/zloop
16      CORE_DIR: /mnt/zloop/cores
17    steps:
18    - uses: actions/checkout@v4
19      with:
20        ref: ${{ github.event.pull_request.head.sha }}
21    - name: Install dependencies
22      run: |
23        sudo apt-get purge -y snapd google-chrome-stable firefox
24        ONLY_DEPS=1 .github/workflows/scripts/qemu-3-deps-vm.sh ubuntu24
25    - name: Autogen.sh
26      run: |
27        sed -i '/DEBUG_CFLAGS="-Werror"/s/^/#/' config/zfs-build.m4
28        ./autogen.sh
29    - name: Configure
30      run: |
31        ./configure --prefix=/usr --enable-debug --enable-debuginfo \
32           --enable-asan --enable-ubsan \
33           --enable-debug-kmem --enable-debug-kmem-tracking
34    - name: Make
35      run: |
36        make -j$(nproc)
37    - name: Install
38      run: |
39        sudo make install
40        sudo depmod
41        sudo modprobe zfs
42    - name: Tests
43      run: |
44        sudo truncate -s 256G /mnt/vdev
45        sudo zpool create cipool -m $WORK_DIR -O compression=on -o autotrim=on /mnt/vdev
46        sudo /usr/share/zfs/zloop.sh -t 600 -I 6 -l -m 1 -c $CORE_DIR -f $WORK_DIR -- -T 120 -P 60
47    - name: Prepare artifacts
48      if: failure()
49      run: |
50        sudo chmod +r -R $WORK_DIR/
51    - name: Ztest log
52      if: failure()
53      run: |
54        grep -B10 -A1000 'ASSERT' $CORE_DIR/*/ztest.out || tail -n 1000 $CORE_DIR/*/ztest.out
55    - name: Gdb log
56      if: failure()
57      run: |
58        sed -n '/Backtraces (full)/q;p' $CORE_DIR/*/ztest.gdb
59    - name: Zdb log
60      if: failure()
61      run: |
62        cat $CORE_DIR/*/ztest.zdb
63    - uses: actions/upload-artifact@v4
64      if: failure()
65      with:
66        name: Logs
67        path: |
68          /mnt/zloop/*/
69          !/mnt/zloop/cores/*/vdev/
70        if-no-files-found: ignore
71    - uses: actions/upload-artifact@v4
72      if: failure()
73      with:
74        name: Pool files
75        path: |
76          /mnt/zloop/cores/*/vdev/
77        if-no-files-found: ignore
78