fixup! test with fuse 2 and 3 #31
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-latest | |
| 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 | |
| - 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: | |
| os: ['macos-latest', 'ubuntu-latest'] | |
| # https://endoflife.date/python | |
| python-version: ['3.9', '3.12', '3.13'] | |
| include: | |
| - os: ubuntu-latest | |
| python-version: '3.14.0-alpha.0' | |
| - os: ubuntu-22.04 | |
| python-version: '3.7' | |
| - os: ubuntu-22.04 | |
| python-version: '3.8' | |
| 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 fuse3 | |
| - 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 | |
| python3 -m pip install --upgrade-strategy eager --upgrade twine build pytest | |
| - 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 .[full] | |
| - name: Test Import | |
| run: | | |
| python3 -c 'import mfusepy' | |
| - name: Unit Tests (FUSE 2) | |
| if: startsWith( matrix.os, 'ubuntu' ) | |
| run: | | |
| python3 -c 'import mfusepy; assert mfusepy.fuse_version_major == 2' | |
| python3 -m pytest 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 tests |