Avoid two 64-bit divisions per scanned block
[zfs.git] / .github / workflows / zfs-tests-functional.yml
blob328cb97f10e4ed166cae3235bd2536a1aa03b7ad
1 name: zfs-tests-functional
3 on:
4   push:
5   pull_request:
7 jobs:
8   tests-functional-ubuntu:
9     strategy:
10       fail-fast: false
11       matrix:
12         os: [18.04, 20.04]
13     runs-on: ubuntu-${{ matrix.os }}
14     steps:
15     - uses: actions/checkout@v2
16       with:
17         ref: ${{ github.event.pull_request.head.sha }}
18     - name: Reclaim disk space
19       run: |
20         ${{ github.workspace }}/.github/workflows/scripts/reclaim_disk_space.sh
21     - name: Install dependencies
22       run: |
23         sudo apt-get update
24         xargs --arg-file=${{ github.workspace }}/.github/workflows/build-dependencies.txt sudo apt-get install -qq
25         sudo apt-get clean
26     - name: Autogen.sh
27       run: |
28         ./autogen.sh
29     - name: Configure
30       run: |
31         ./configure --enable-debug --enable-debuginfo --enable-asan --enable-ubsan --with-config=dist
32     - name: Make
33       run: |
34         make -j$(nproc) --no-print-directory --silent pkg-utils pkg-kmod
35     - name: Install
36       run: |
37         sudo dpkg -i *.deb
38         # Update order of directories to search for modules, otherwise
39         #   Ubuntu will load kernel-shipped ones.
40         sudo sed -i.bak 's/updates/extra updates/' /etc/depmod.d/ubuntu.conf
41         sudo depmod
42         sudo modprobe zfs
43         # Workaround for cloud-init bug
44         # see https://github.com/openzfs/zfs/issues/12644
45         FILE=/lib/udev/rules.d/10-cloud-init-hook-hotplug.rules
46         if [ -r "${FILE}" ]; then
47           HASH=$(md5sum "${FILE}" | awk '{ print $1 }')
48           if [ "${HASH}" = "121ff0ef1936cd2ef65aec0458a35772" ]; then
49             # Just shove a zd* exclusion right above the hotplug hook...
50             sudo sed -i -e s/'LABEL="cloudinit_hook"'/'KERNEL=="zd*", GOTO="cloudinit_end"\n&'/ "${FILE}"
51             sudo udevadm control --reload-rules
52           fi
53         fi
54     - name: Clear the kernel ring buffer
55       run: |
56         sudo dmesg -c >/var/tmp/dmesg-prerun
57     - name: Report disk space
58       run: |
59         df -h /
60     - name: Tests
61       run: |
62         set -o pipefail
63         /usr/share/zfs/zfs-tests.sh -vKR -s 3G | scripts/zfs-tests-color.sh
64       shell: bash
65       timeout-minutes: 330
66     - name: Prepare artifacts
67       if: failure()
68       run: |
69         RESULTS_PATH=$(readlink -f /var/tmp/test_results/current)
70         sudo dmesg > $RESULTS_PATH/dmesg
71         sudo cp /var/log/syslog /var/tmp/dmesg-prerun $RESULTS_PATH/
72         sudo chmod +r $RESULTS_PATH/*
73         # Replace ':' in dir names, actions/upload-artifact doesn't support it
74         for f in $(find /var/tmp/test_results -name '*:*'); do mv "$f" "${f//:/__}"; done
75     - uses: actions/upload-artifact@v2
76       if: failure()
77       with:
78         name: Test logs Ubuntu-${{ matrix.os }}
79         path: |
80           /var/tmp/test_results/*
81           !/var/tmp/test_results/current
82         if-no-files-found: ignore