github actions: omit user tests for pull requests #48
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 | |
| if: github.event_name != 'pull_request' | |
| run: | | |
| echo "=== Alpine Linux (3.24.1) - BEGIN" | |
| ./proot-distro.py install -n alpine-3.24.1 alpine:3.24.1 | |
| ./proot-distro.py login alpine-3.24.1 -- cat /etc/os-release | |
| ./proot-distro.py login alpine-3.24.1 -- apk update | |
| ./proot-distro.py rename alpine-3.24.1 alpine-3.24.1-renamed | |
| ./proot-distro.py backup -o /tmp/alpine.tar.gz alpine-3.24.1-renamed | |
| ./proot-distro.py restore /tmp/alpine.tar.gz | |
| ./proot-distro.py rm alpine-3.24.1-renamed | |
| echo "=== Alpine Linux (3.24.1) - FINISH" | |
| echo "=== Debian (trixie) - BEGIN" | |
| ./proot-distro.py install -n debian-trixie debian:trixie | |
| ./proot-distro.py login debian-trixie -- cat /etc/os-release | |
| ./proot-distro.py login debian-trixie -- apt update | |
| ./proot-distro.py rename debian-trixie debian-trixie-renamed | |
| ./proot-distro.py backup -o /tmp/debian.tar.gz debian-trixie-renamed | |
| ./proot-distro.py restore /tmp/debian.tar.gz | |
| ./proot-distro.py rm debian-trixie-renamed | |
| echo "=== Debian (trixie) - FINISH" | |
| echo "=== Ubuntu (24.04) - BEGIN" | |
| ./proot-distro.py install -n ubuntu-24.04 ubuntu:24.04 | |
| ./proot-distro.py login ubuntu-24.04 -- cat /etc/os-release | |
| ./proot-distro.py login ubuntu-24.04 -- apt update | |
| ./proot-distro.py rename ubuntu-24.04 ubuntu-24.04-renamed | |
| ./proot-distro.py backup -o /tmp/ubuntu.tar.gz ubuntu-24.04-renamed | |
| ./proot-distro.py restore /tmp/ubuntu.tar.gz | |
| ./proot-distro.py rm ubuntu-24.04-renamed | |
| echo "=== Ubuntu (24.04) - FINISH" |