1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
|
# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0:
.templates_sha: &templates_sha 007f3e2fe2235328e77d3cd4ce007ab41cd9ce6c
include:
- project: 'freedesktop/ci-templates'
ref: *templates_sha
file: '/templates/fedora.yml'
- project: 'freedesktop/ci-templates'
ref: *templates_sha
file: '/templates/ci-fairy.yml'
variables:
FDO_UPSTREAM_REPO: 'libevdev/python-libevdev'
ARCH_PKGS: 'flake8'
stages:
- prep
- test
- deploy
.fedora:
variables:
FDO_DISTRIBUTION_VERSION: 34
FDO_DISTRIBUTION_TAG: 'qemu-2021-08-24.0'
FDO_DISTRIBUTION_PACKAGES: 'git python3 python3-pytest libevdev python3-flake8'
.fedora-qemu:
extends:
.fedora
variables:
FDO_DISTRIBUTION_TAG: '2021-08-24.0'
#
# Verify that commit messages are as expected, etc.
#
check-commit:
extends:
- .fdo.ci-fairy
stage: prep
script:
- ci-fairy check-commits --junit-xml=results.xml
except:
- master@libevdev/python-libevdev
variables:
GIT_DEPTH: 100
artifacts:
reports:
junit: results.xml
#
# Verify that the merge request has the allow-collaboration checkbox ticked
#
check-merge-request:
extends:
- .fdo.ci-fairy
stage: deploy
script:
- ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml
artifacts:
when: on_failure
reports:
junit: results.xml
allow_failure: true
#
# Prep one regular container for flake and setup.py, one qemu image for pytest
#
container-prep:
extends:
- .fedora
- .fdo.container-build@fedora
stage: prep
variables:
GIT_STRATEGY: none
qemu-prep:
extends:
- .fedora-qemu
- .fdo.qemu-build@fedora
stage: prep
variables:
GIT_STRATEGY: none
pytest:
extends:
- .fedora-qemu
- .fdo.distribution-image@fedora
stage: test
needs:
- qemu-prep
script:
- /app/vmctl start || (echo "Error - Failed to start the VM." && exit 1)
- "scp -r $PWD vm:"
# We must not exit our script until VM cleanup is complete
- set +e
- /app/vmctl exec "cd $CI_PROJECT_NAME ; pytest --junit-xml=results.xml" && touch .success || true
- scp -r vm:$CI_PROJECT_NAME/results.xml
- /app/vmctl stop
- test -e .success || exit 1
artifacts:
reports:
junit: results.xml
flake:
extends:
- .fedora
- .fdo.distribution-image@fedora
stage: test
needs:
- container-prep
script:
- python3 setup.py flake8
install:
extends:
- .fedora
- .fdo.distribution-image@fedora
stage: test
needs:
- container-prep
script:
- python3 setup.py install
|