Revival #4
This file contains hidden or 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
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| lint: | |
| name: Static checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - name: Install toolchain | |
| run: | | |
| pip install setuptools wheel | |
| pip install -r requirements-dev.txt | |
| pip install gitpython freebsd_sysctl==0.0.7 | |
| pip install --no-build-isolation jail==0.0.12 | |
| - name: Run static checks | |
| run: sh scripts/check.sh | |
| unit: | |
| name: Unit tests (Linux subset) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - name: Install dependencies | |
| run: | | |
| pip install setuptools wheel | |
| pip install -r requirements-test.txt | |
| pip install gitpython freebsd_sysctl==0.0.7 | |
| pip install --no-build-isolation jail==0.0.12 | |
| - name: Run the platform-independent tests | |
| run: pytest --cov=libioc --cov-report=term | |
| freebsd: | |
| name: Test suite (FreeBSD 13.5) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Boot the FreeBSD VM | |
| uses: no-pictures/freebsd-ci/.github/actions/setup-vm@vm-tooling | |
| with: | |
| version: 13.5-RELEASE | |
| - name: Prepare the guest | |
| uses: no-pictures/freebsd-ci/.github/actions/run@vm-tooling | |
| with: | |
| sync-workspace: "false" | |
| run: | | |
| mkdir -p /usr/local/etc/pkg/repos | |
| echo 'FreeBSD: { url: "pkg+https://pkg.FreeBSD.org/${ABI}/latest" }' > /usr/local/etc/pkg/repos/FreeBSD.conf | |
| env ASSUME_ALWAYS_YES=yes pkg bootstrap -f | |
| pkg update -f | |
| PYPKG="$(pkg search -q '^py3[0-9]*-libzfs' | head -n 1 | sed 's/-libzfs.*//')" | |
| pkg install -y python3 "${PYPKG}-libzfs" "${PYPKG}-ucl" "${PYPKG}-sqlite3" "${PYPKG}-setuptools" "${PYPKG}-pip" git rsync | |
| mount -t fdescfs null /dev/fd | |
| kldload if_epair 2>/dev/null || true | |
| kldload zfs 2>/dev/null || true | |
| mkdir -p /pools | |
| truncate -s 8G /pools/ioc-test.img | |
| zpool create -m /.ioc-test ioc-test /pools/ioc-test.img | |
| zfs set compression=lz4 ioc-test | |
| PYBIN="$(ls /usr/local/bin/ | grep -E '^python3\.[0-9]+$' | head -n 1)" | |
| "/usr/local/bin/${PYBIN}" -m venv --system-site-packages /root/venv | |
| /root/venv/bin/pip install -q -U pip setuptools wheel | |
| - name: Run the test suite | |
| uses: no-pictures/freebsd-ci/.github/actions/run@vm-tooling | |
| with: | |
| run: | | |
| /root/venv/bin/pip install -q --no-build-isolation -r requirements.txt -r requirements-test.txt | |
| /root/venv/bin/pip install -q --no-build-isolation -e . | |
| /root/venv/bin/pytest tests --zpool ioc-test |