xref: /freebsd/sys/contrib/openzfs/.github/workflows/zfs-tests.yml (revision fe6060f10f634930ff71b7c50291ddc610da2475)
1name: zfs-tests-sanity
2
3on:
4  push:
5  pull_request:
6
7jobs:
8  tests:
9    runs-on: ubuntu-latest
10    steps:
11    - uses: actions/checkout@v2
12      with:
13        ref: ${{ github.event.pull_request.head.sha }}
14    - name: Install dependencies
15      run: |
16        sudo apt-get update
17        sudo apt-get install --yes -qq build-essential autoconf libtool gdb lcov \
18          git alien fakeroot wget curl bc fio acl \
19          sysstat mdadm lsscsi parted gdebi attr dbench watchdog ksh \
20          nfs-kernel-server samba rng-tools xz-utils \
21          zlib1g-dev uuid-dev libblkid-dev libselinux-dev \
22          xfslibs-dev libattr1-dev libacl1-dev libudev-dev libdevmapper-dev \
23          libssl-dev libffi-dev libaio-dev libelf-dev libmount-dev \
24          libpam0g-dev pamtester python-dev python-setuptools python-cffi \
25          python3 python3-dev python3-setuptools python3-cffi
26    - name: Autogen.sh
27      run: |
28        sh autogen.sh
29    - name: Configure
30      run: |
31        ./configure --enable-debug --enable-debuginfo
32    - name: Make
33      run: |
34        make --no-print-directory -s 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    - name: Tests
44      run: |
45        /usr/share/zfs/zfs-tests.sh -v -s 3G -r sanity
46    - name: Prepare artifacts
47      if: failure()
48      run: |
49        RESULTS_PATH=$(readlink -f /var/tmp/test_results/current)
50        sudo dmesg > $RESULTS_PATH/dmesg
51        sudo cp /var/log/syslog $RESULTS_PATH/
52        sudo chmod +r $RESULTS_PATH/*
53    - uses: actions/upload-artifact@v2
54      if: failure()
55      with:
56        name: Test logs
57        path: /var/tmp/test_results/20*/
58        if-no-files-found: ignore
59