NetBSD: use librefuse #381
Workflow file for this run
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: Tests | |
| on: | |
| push: | |
| branches: '**' | |
| tags-ignore: '**' | |
| pull_request: | |
| jobs: | |
| Tests: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # https://endoflife.date/python | |
| include: | |
| - os: ubuntu-24.04 | |
| python-version: '3.14' | |
| env: | |
| MFUSEPY_CHECK_OVERRIDES: 1 | |
| defaults: | |
| run: | |
| # This is especially important for windows because it seems to default to powershell | |
| shell: bash | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # We need one tag for testing the git mount. | |
| # This is BROKEN! God damn it. Is anything working at all... | |
| # https://github.com/actions/checkout/issues/1781 | |
| fetch-tags: true | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install Dependencies (Linux) | |
| if: startsWith( matrix.os, 'ubuntu' ) | |
| run: | | |
| sudo apt-get -y install libfuse2 libfuse-dev libfuse3-dev fuse3 wget | |
| - name: Install Dependencies (MacOS) | |
| if: startsWith( matrix.os, 'macos' ) | |
| run: | | |
| brew install -q macfuse | |
| - name: Install pip Dependencies | |
| run: | | |
| python3 -m pip install --upgrade pip | |
| python3 -m pip install --upgrade wheel | |
| python3 -m pip install --upgrade setuptools | |
| # https://github.com/pyca/pynacl/issues/839 | |
| # https://github.com/pyca/pynacl/pull/848 | |
| python3 -m pip install --upgrade git+https://github.com/pyca/pynacl.git | |
| python3 -m pip install --upgrade-strategy eager --upgrade twine build pytest ioctl-opt paramiko types-paramiko | |
| - name: Test Installation From Tarball | |
| run: | | |
| python3 -m build | |
| twine check dist/* | |
| python3 -m pip install "$( find dist -name '*.tar.gz' | head -1 )"[full] | |
| - name: Test Installation From Source | |
| run: | | |
| python3 -m pip install . | |
| - name: Test Import | |
| run: | | |
| python3 -c 'import mfusepy' | |
| - name: Examples | |
| run: | | |
| # Simply parsing the source runs the @overrides check! | |
| for file in examples/*.py; do | |
| python3 "$file" -h | |
| done | |
| - name: Unit Tests (FUSE 2) | |
| if: startsWith( matrix.os, 'ubuntu' ) | |
| run: | | |
| python3 -c 'import mfusepy; assert mfusepy.fuse_version_major == 2' | |
| python3 -m pytest -v -rs tests | |
| - name: Unit Tests (FUSE 3) | |
| if: startsWith( matrix.os, 'ubuntu' ) | |
| run: | | |
| export FUSE_LIBRARY_PATH=$( dpkg -L libfuse3-3 | 'grep' -F .so | head -1 ) | |
| python3 -c 'import mfusepy; assert mfusepy.fuse_version_major == 3' | |
| python3 -m pytest -v -rs tests | |
| - name: Test Compatibility (Ratarmount) | |
| if: startsWith( matrix.os, 'ubuntu' ) | |
| run: | | |
| python3 -m pip install ratarmount | |
| python3 -m pip install --force-reinstall . | |
| mkdir -p mounted-tar | |
| wget https://github.com/mxmlnkn/ratarmount/raw/refs/heads/master/tests/single-file.tar | |
| ratarmount single-file.tar mounted-tar | |
| [[ "$( cat mounted-tar/bar )" == "foo" ]] | |
| fusermount -u mounted-tar | |
| - name: Test Compatibility (ninfs) | |
| if: ${{ startsWith( matrix.os, 'ubuntu' ) && matrix.python-version != '3.7' }} | |
| run: | | |
| python3 -m pip install git+https://github.com/ihaveamac/ninfs.git@main | |
| python3 -m pip install --force-reinstall . | |
| mkdir -p mounted-3dsx | |
| wget https://github.com/videah/3dsfetch/raw/refs/heads/master/3dsfetch.3dsx | |
| ninfs threedsx 3dsfetch.3dsx mounted-3dsx | |
| [[ "$( md5sum mounted-3dsx/icon.smdh )" =~ "a3d784b6f20182ebdf964589cbf427c2" ]] | |
| fusermount -u mounted-3dsx | |
| VM-Tests: | |
| # Run tests inside a VM using cross-platform-actions | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| matrix: | |
| include: | |
| - os: freebsd | |
| version: '14.3' | |
| display_name: FreeBSD | |
| - os: openbsd | |
| version: '7.7' | |
| display_name: OpenBSD | |
| - os: netbsd | |
| version: '10.1' | |
| display_name: NetBSD | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-tags: true | |
| - name: Test on ${{ matrix.display_name }} | |
| uses: cross-platform-actions/action@v0.29.0 | |
| with: | |
| operating_system: ${{ matrix.os }} | |
| version: ${{ matrix.version }} | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| case "${{ matrix.os }}" in | |
| freebsd) | |
| # Ensure a proper hostname/FQDN is set (VMs may not have one by default) | |
| sudo -E /bin/sh -c 'grep -q "freebsd\.local" /etc/hosts || echo "127.0.0.1 freebsd.local freebsd" >> /etc/hosts' | |
| sudo -E hostname freebsd.local | |
| hostname | |
| # Keep pkg from aborting on minor version drift | |
| export IGNORE_OSVERSION=yes | |
| # Packages | |
| sudo -E pkg update -f | |
| sudo -E pkg install -y git fusefs-libs python3 python311 py311-pip | |
| # Make FUSE work | |
| sudo -E kldload fusefs | |
| sudo -E sysctl vfs.usermount=1 | |
| sudo -E chmod 666 /dev/fuse | |
| # Install pip Dependencies | |
| python3 -m pip install --upgrade pip | |
| python3 -m pip install --upgrade wheel | |
| python3 -m pip install --upgrade setuptools | |
| python3 -m pip install "pynacl==1.5.0" | |
| python3 -m pip install pytest ioctl-opt | |
| # Test Installation From Source | |
| python3 -m pip install . | |
| # Unit Tests (FUSE 2) | |
| python3 -c 'import mfusepy; assert mfusepy.fuse_version_major == 2' | |
| python3 -m pytest -v -rs tests | |
| ;; | |
| openbsd) | |
| # Ensure a proper hostname/FQDN is set (VMs may not have one by default) | |
| sudo -E /bin/sh -c 'grep -q "openbsd\.local" /etc/hosts || echo "127.0.0.1 openbsd.local openbsd" >> /etc/hosts' | |
| sudo -E hostname openbsd.local | |
| hostname | |
| # Packages | |
| sudo -E pkg_add git py3-pip py3-virtualenv py3-tox | |
| sudo -E pkg_add sshfs-fuse # needed for sideeffect of having fuse 2.6? | |
| # Install pip Dependencies | |
| python3 -m venv .venv | |
| source .venv/bin/activate | |
| python3 -m pip install --upgrade pip | |
| python3 -m pip install --upgrade wheel | |
| python3 -m pip install --upgrade setuptools | |
| python3 -m pip install "pynacl==1.5.0" | |
| python3 -m pip install pytest ioctl-opt | |
| # Test Installation From Source | |
| python3 -m pip install . | |
| # Unit Tests (FUSE 2) | |
| python3 -c 'import mfusepy; assert mfusepy.fuse_version_major == 2' | |
| # FUSE mounting only works as root on OpenBSD | |
| sudo -E .venv/bin/python3 -m pytest -v -rs tests | |
| ;; | |
| netbsd) | |
| # Ensure a proper hostname/FQDN is set (VMs may not have one by default) | |
| sudo -E /bin/sh -c 'grep -q "netbsd\.local" /etc/hosts || echo "127.0.0.1 netbsd.local netbsd" >> /etc/hosts' | |
| sudo -E hostname netbsd.local | |
| hostname | |
| # Packages | |
| sudo -E pkgin -y update | |
| sudo -E pkgin -y install git pkgconf python311 py311-pip | |
| sudo -E ln -sf /usr/pkg/bin/python3.11 /usr/pkg/bin/python3 | |
| # Fix PATH | |
| export PATH="/usr/pkg/bin:/usr/pkg/sbin:/sbin:/usr/sbin:$PATH" | |
| # Make FUSE work (NetBSD) | |
| sudo sysctl -w vfs.generic.usermount=1 | |
| sudo sysctl -w kern.sbmax=4194304 | |
| sudo chmod 666 /dev/puffs | |
| # Install pip Dependencies | |
| python3 -m pip install --upgrade pip | |
| python3 -m pip install --upgrade wheel | |
| python3 -m pip install --upgrade setuptools | |
| python3 -m pip install "pynacl==1.5.0" | |
| python3 -m pip install pytest ioctl-opt | |
| # Test Installation From Source | |
| python3 -m pip install . | |
| # Unit Tests (FUSE 2 via NetBSD librefuse) | |
| python3 -c 'import mfusepy; assert mfusepy.fuse_version_major == 2' | |
| # preserve pytest exit status, always show logs | |
| rc=0 | |
| # for now, run the tests as root, too many PermissionErrors: | |
| sudo -E python3 -m pytest -v -rs tests || rc=$? | |
| exit "$rc" | |
| ;; | |
| esac |