github actions: add user tests involving actual utility usage #46
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: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: tests-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: Test suite (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Cover the floor and the latest of the supported range | |
| # (pyproject: requires-python = ">=3.9"). | |
| python-version: ['3.9', '3.11', '3.13'] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| cache-dependency-path: pyproject.toml | |
| - name: Install package with test extra | |
| run: | | |
| sudo apt update && sudo apt install -yq proot | |
| python -m pip install --upgrade pip | |
| pip install -e '.[test]' | |
| - name: Unit tests | |
| run: python -m pytest tests/unit | |
| - name: Integration tests | |
| run: python -m pytest tests/integration | |
| - name: Security tests | |
| run: python -m pytest tests/security | |
| - name: Live tests | |
| run: RUN_LIVE_TESTS=1 python -m pytest -q tests/live | |
| - name: User tests | |
| run: | | |
| echo "=== Debian (trixie) - BEGIN" | |
| ./proot-distro.py install -n debian-trixie debian:trixie | |
| ./proot-distro login debian-trixie -- cat /etc/os-release | |
| ./proot-distro login debian-trixie -- apt update | |
| ./proot-distro rename debian-trixie debian-trixie-renamed | |
| ./proot-distro backup -o /tmp/debian.tar.gz debian-trixie-renamed | |
| ./proot-distro restore /tmp/debian.tar.gz | |
| ./proot-distro rm debian-trixie-renamed | |
| echo "=== Debian (trixie) - FINISH" |