CI: test on OmniOS r151056 #435
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: | |
| Static-Code-Checks: | |
| runs-on: ubuntu-slim | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install Dependencies | |
| run: | | |
| python3 -m pip install ioctl-opt paramiko types-paramiko pytest | |
| - name: Style Check With Ruff | |
| run: | | |
| python3 -m pip install ruff | |
| ruff check --config tests/.ruff.toml -- $( git ls-tree -r --name-only HEAD | 'grep' -E '[.]py$' ) | |
| - name: Style Check With Black | |
| run: | | |
| python3 -m pip install black | |
| black -q --diff --line-length 120 --skip-string-normalization $( git ls-tree -r --name-only HEAD | 'grep' -E '[.]py$' ) > black.diff | |
| if [ -s black.diff ]; then | |
| cat black.diff | |
| exit 123 | |
| fi | |
| - name: Lint With Codespell | |
| run: | | |
| python3 -m pip install codespell | |
| codespell $( git ls-tree -r --name-only HEAD | 'grep' -E '[.](py|md|txt|sh|yml)$' ) | |
| - name: Lint With Flake8 | |
| run: | | |
| python3 -m pip install flake8 | |
| flake8 --config tests/.flake8 $( git ls-tree -r --name-only HEAD | 'grep' -E '[.]py$' ) | |
| - name: Lint With Pylint | |
| run: | | |
| python3 -m pip install pylint | |
| pylint --rcfile tests/.pylintrc $( git ls-tree -r --name-only HEAD | 'grep' -E '[.]py$' ) | tee pylint.log | |
| ! 'egrep' ': E[0-9]{4}: ' pylint.log | |
| - name: Lint With Pytype | |
| run: | | |
| python3 -m pip install pytype | |
| pytype -d import-error $( git ls-tree -r --name-only HEAD | 'grep' -E '[.]py$' ) | |
| - name: Lint With Mypy | |
| run: | | |
| yes | python3 -m pip install --upgrade-strategy eager --upgrade types-dataclasses mypy | |
| mypy --config-file tests/.mypy.ini $( git ls-tree -r --name-only HEAD | 'grep' -E '[.]py$' ) | |
| Tests: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| # https://endoflife.date/python | |
| include: | |
| - os: ubuntu-22.04 | |
| python-version: '3.9' | |
| - os: ubuntu-22.04-arm | |
| python-version: '3.10' | |
| - os: ubuntu-22.04 | |
| python-version: '3.11' | |
| - os: ubuntu-24.04-arm | |
| python-version: '3.12' | |
| - os: ubuntu-24.04 | |
| python-version: '3.13' | |
| - os: ubuntu-24.04 | |
| python-version: '3.14' | |
| - os: macos-15 | |
| python-version: '3.9' | |
| - os: macos-14 | |
| python-version: '3.10' | |
| - os: macos-15-intel | |
| python-version: '3.11' | |
| - os: macos-14 | |
| python-version: '3.12' | |
| - os: macos-15-intel | |
| python-version: '3.13' | |
| - os: macos-15 | |
| 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 pytest-order 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: Only test struct layout (MacOS) | |
| if: startsWith( matrix.os, 'macos' ) | |
| run: | | |
| python3 -m pytest -s -v -rs tests/test_struct_layout.py | |
| - 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 | |
| ratarmount tests/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 | |
| ninfs threedsx tests/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: freebsd | |
| version: '13.5' | |
| display_name: FreeBSD | |
| - os: openbsd | |
| version: '7.7' | |
| display_name: OpenBSD | |
| # OpenBSD 6.9 is not supported because it only has Python 3.8, which is not supported anymore. | |
| # NetBSD 9.4 is not supported because its interface seems to mirror libFUSE 2.6 and therefore is HIGHLY | |
| # incompatible. Even fuse_context.umask is missing! | |
| - os: netbsd | |
| version: '10.1' | |
| display_name: NetBSD | |
| - os: omnios | |
| version: r151056 | |
| display_name: OmniOS | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-tags: true | |
| - name: Test on ${{ matrix.display_name }} | |
| uses: cross-platform-actions/[email protected] | |
| 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 pytest pytest-order 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 -s -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 pytest pytest-order 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 -s -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 fuse perfuse 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 | |
| # avoid permissions issue for perfused trace file: | |
| sudo chmod 777 /var/run | |
| # Install pip Dependencies | |
| python3 -m pip install pytest pytest-order ioctl-opt | |
| # Test Installation From Source | |
| python3 -m pip install . | |
| # preserve pytest exit status, always show logs | |
| rc=0 | |
| python3 -m pytest -s -v -rs tests/test_struct_layout.py | |
| # for now, run the tests as root, too many PermissionErrors: | |
| sudo -E python3 -m pytest -s -v -rs tests || rc=$? | |
| exit "$rc" | |
| ;; | |
| omnios) | |
| # Ensure a proper hostname/FQDN is set (VMs may not have one by default) | |
| pfexec /bin/sh -c 'grep -q "omnios\.local" /etc/hosts || echo "127.0.0.1 omnios.local omnios" >> /etc/hosts' | |
| pfexec hostname omnios.local | |
| hostname | |
| # Packages | |
| pfexec pkg install developer/versioning/git | |
| pfexec pkg install developer/gcc14 | |
| pfexec pkg set-mediator -V 14 gcc | |
| # driver + libfuse | |
| pfexec pkg set-publisher -p https://sfe.opencsw.org/localhostomnios localhostomnios | |
| pfexec pkg refresh localhostomnios | |
| pfexec pkg install --accept system/file-system/fusefs | |
| pfexec pkg install --accept system/file-system/libfuse | |
| # pfexec pkg install --accept system/file-system/libfuse/src | |
| pkg list system/file-system/fusefs | |
| pkg list system/file-system/libfuse | |
| # pkg list system/file-system/libfuse/src | |
| pkg contents system/file-system/fusefs | |
| pkg contents system/file-system/libfuse | |
| # pkg contents system/file-system/libfuse/src | |
| # Fetch custom build from Tom and install it | |
| modinfo | grep fuse | awk '{print $1}' | while read id; do pfexec modunload -i $id; done | |
| modinfo | grep fuse || true | |
| curl -L https://www.wagner-net.com/~tom/fuse-files-sfe-omnios-r151054-f66c95f374.tar.bz2 -o /tmp/fuse-files.tar.bz2 | |
| pushd / | |
| pfexec tar xvjf /tmp/fuse-files.tar.bz2 | |
| popd | |
| ls -l /usr/gnu/lib/amd64/libfuse.so.2.7.1 /usr/gnu/lib/libfuse.so.2.7.1 /usr/kernel/drv/amd64/fuse | |
| # Install pip Dependencies | |
| python3 -m pip install pytest pytest-order ioctl-opt | |
| # Fix PATH | |
| export PATH="/home/runner/.local/bin:$PATH" | |
| echo $PATH | |
| # Test Installation From Source | |
| python3 -m pip install . | |
| # Unit Tests (FUSE 2) | |
| python3 -c 'import mfusepy; assert mfusepy.fuse_version_major == 2' | |
| # preserve pytest exit status, always show logs | |
| rc=0 | |
| pfexec python3 -m pytest -v -rs tests || rc=$? | |
| exit "$rc" | |
| ;; | |
| esac |