|
| 1 | +# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0: |
| 2 | + |
| 3 | +.templates_sha: &templates_sha aec7a6ce7bb38902c70641526f6611e27141784a |
| 4 | + |
| 5 | +include: |
| 6 | + - project: 'freedesktop/ci-templates' |
| 7 | + ref: *templates_sha |
| 8 | + file: '/templates/fedora.yml' |
| 9 | + - project: 'freedesktop/ci-templates' |
| 10 | + ref: *templates_sha |
| 11 | + file: '/templates/ci-fairy.yml' |
| 12 | + |
| 13 | + |
| 14 | +workflow: |
| 15 | + rules: |
| 16 | + - if: $CI_PIPELINE_SOURCE == "merge_request_event" |
| 17 | + - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS |
| 18 | + when: never |
| 19 | + - if: $CI_COMMIT_BRANCH |
| 20 | + |
| 21 | +variables: |
| 22 | + FDO_UPSTREAM_REPO: 'libevdev/python-libevdev' |
| 23 | + |
| 24 | + |
| 25 | +stages: |
| 26 | + - prep |
| 27 | + - test |
| 28 | + - deploy |
| 29 | + |
| 30 | +.policy: |
| 31 | + retry: |
| 32 | + max: 2 |
| 33 | + when: |
| 34 | + - runner_system_failure |
| 35 | + - stuck_or_timeout_failure |
| 36 | + # cancel run when a newer version is pushed to the branch |
| 37 | + interruptible: true |
| 38 | + dependencies: [] |
| 39 | + |
| 40 | +.fedora: |
| 41 | + extends: |
| 42 | + - .policy |
| 43 | + variables: |
| 44 | + FDO_DISTRIBUTION_VERSION: 42 |
| 45 | + FDO_DISTRIBUTION_TAG: '2025-11-14.0' |
| 46 | + FDO_DISTRIBUTION_PACKAGES: 'git python3 python3.9 python3.10 python3.11 python3-pytest python3-pytest-timeout libevdev virtme-ng qemu-img qemu-system-x86-core binutils file systemd-udev uv python3-hatchling' |
| 47 | + |
| 48 | +# |
| 49 | +# Verify that commit messages are as expected, etc. |
| 50 | +# |
| 51 | + |
| 52 | +check-commit: |
| 53 | + extends: |
| 54 | + - .fdo.ci-fairy |
| 55 | + stage: prep |
| 56 | + script: |
| 57 | + - ci-fairy check-commits --junit-xml=results.xml |
| 58 | + except: |
| 59 | + - master@libevdev/python-libevdev |
| 60 | + variables: |
| 61 | + GIT_DEPTH: 100 |
| 62 | + artifacts: |
| 63 | + reports: |
| 64 | + junit: results.xml |
| 65 | + |
| 66 | +container-prep: |
| 67 | + extends: |
| 68 | + - .fedora |
| 69 | + - .fdo.container-build@fedora |
| 70 | + stage: prep |
| 71 | + variables: |
| 72 | + GIT_STRATEGY: none |
| 73 | + |
| 74 | +pre-commit-hooks: |
| 75 | + extends: |
| 76 | + - .fdo.ci-fairy |
| 77 | + stage: prep |
| 78 | + script: |
| 79 | + - python3 -m venv venv |
| 80 | + - source venv/bin/activate |
| 81 | + - pip3 install pre-commit |
| 82 | + - pre-commit run --all-files |
| 83 | + - git diff --exit-code || (echo "ERROR - Code style errors found, please fix" && false) |
| 84 | + |
| 85 | +pytest: |
| 86 | + extends: |
| 87 | + - .fedora |
| 88 | + - .fdo.distribution-image@fedora |
| 89 | + stage: test |
| 90 | + tags: |
| 91 | + - kvm |
| 92 | + parallel: |
| 93 | + matrix: |
| 94 | + # We tests the ones most likely to break and the current default |
| 95 | + - PYTHON_VERSION: ["3", "3.9", "3.10", "3.11"] |
| 96 | + variables: |
| 97 | + VNG_KERNEL: https://gitlab.freedesktop.org/api/v4/projects/libevdev%2Fhid-tools/packages/generic/kernel-x86_64/v6.14/bzImage |
| 98 | + script: |
| 99 | + - curl -LO $VNG_KERNEL |
| 100 | + - export -p > .vngenv |
| 101 | + - uv sync --python $PYTHON_VERSION |
| 102 | + - uv add --dev pytest-timeout |
| 103 | + - | |
| 104 | + vng --exec "source $PWD/.vngenv; rm $PWD/.vngenv; uv run --python $PYTHON_VERSION pytest --verbose --junit-xml=results.xml --session-timeout=600" \ |
| 105 | + --run ./bzImage \ |
| 106 | + --user root \ |
| 107 | + --overlay-rwdir=$HOME \ |
| 108 | + --append HOME=$HOME \ |
| 109 | + --overlay-rwdir=$(pwd) |
| 110 | + artifacts: |
| 111 | + when: always |
| 112 | + reports: |
| 113 | + junit: results.xml |
| 114 | + |
| 115 | +install: |
| 116 | + extends: |
| 117 | + - .fedora |
| 118 | + - .fdo.distribution-image@fedora |
| 119 | + stage: test |
| 120 | + needs: |
| 121 | + - container-prep |
| 122 | + script: |
| 123 | + - uv pip install --system . |
0 commit comments