Add E2E testing infrastructure using mkosi #12
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: E2E Tests | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| e2e-tests: | |
| name: Python ${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.11', '3.12', '3.13', '3.14', '3.14t'] | |
| env: | |
| PYTHON_VERSION: ${{ matrix.python-version }} | |
| UNIT_NAME: pystemd-e2e-py${{ matrix.python-version }}.service | |
| MACHINE_NAME: pystemd-test-py${{ matrix.python-version }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| # - name: Set up latest Python | |
| # uses: actions/setup-python@v4 | |
| - name: setup-mkosi | |
| uses: systemd/mkosi@v26 | |
| - name: Install systemd-container | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y systemd-container | |
| - name: Generate mkosi keys | |
| run: | | |
| sudo mkosi genkey | |
| - name: Build mkosi test image | |
| run: | | |
| sudo mkosi -E "$PYTHON_VERSION" build | |
| - name: run e2e pytest | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libsystemd-dev | |
| uv sync --all-extras | |
| sudo uv run pytest e2e | |