gitlab CI: update docs for how to schedule the auth variable
[platform/upstream/libevdev.git] / .gitlab-ci.yml
1 ########################################
2 #                                      #
3 # THIS FILE IS GENERATED, DO NOT EDIT  #
4 #                                      #
5 ########################################
6
7 .templates_sha: &template_sha ca99d9418390fb5faaa7f2407b94c733d7ec6a37 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
8
9 include:
10   # Alpine container builder template
11   - project: 'freedesktop/ci-templates'
12     ref: *template_sha
13     file: '/templates/alpine.yml'
14   # Arch container builder template
15   - project: 'freedesktop/ci-templates'
16     ref: *template_sha
17     file: '/templates/arch.yml'
18   # Centos container builder template
19   - project: 'freedesktop/ci-templates'
20     ref: *template_sha
21     file: '/templates/centos.yml'
22   # Debian container builder template
23   - project: 'freedesktop/ci-templates'
24     ref: *template_sha
25     file: '/templates/debian.yml'
26   # Fedora container builder template
27   - project: 'freedesktop/ci-templates'
28     ref: *template_sha
29     file: '/templates/fedora.yml'
30   # Ubuntu container builder template
31   - project: 'freedesktop/ci-templates'
32     ref: *template_sha
33     file: '/templates/ubuntu.yml'
34
35 stages:
36   - prep             # rebuild the container images if there is a change
37   - build            # for actually building and testing things in a container
38   - VM               # for running the test suite in a VM
39   - autotools        # distribution builds with autotools
40   - meson            # distribution builds with meson
41   - tarballs         # tarball builds
42   - container_clean  # clean up unused container images
43
44 variables:
45   # The upstrem repository we will check for images
46   FDO_UPSTREAM_REPO: libevdev/libevdev
47   LIBEVDEV_SKIP_ROOT_TESTS: 1
48   GIT_DEPTH: 1
49   MESON_BUILDDIR: 'build dir'
50
51 .default_artifacts:
52   artifacts:
53     paths:
54       - _build/test/test-suite.log
55       - $MESON_BUILDDIR/meson-logs/
56     expire_in: 1 week
57     when: on_failure
58     reports:
59       junit: $MESON_BUILDDIR/junit-*.xml
60
61 .autotools_build:
62   extends:
63     - .default_artifacts
64   script:
65     - mkdir _build
66     - pushd _build > /dev/null
67     - ../autogen.sh --disable-silent-rules $CONFIGURE_FLAGS
68     - make
69     - make check
70     - if ! [[ -z "$MAKE_ARGS" ]]; then make $MAKE_ARGS; fi
71     - popd > /dev/null
72
73 .meson_build:
74   extends:
75     - .default_artifacts
76   script:
77     - .gitlab-ci/meson-build.sh
78
79 .fedora:30:
80   extends: .fdo.distribution-image@fedora
81   variables:
82     FDO_DISTRIBUTION_TAG: '2020-03-17.0'
83     FDO_DISTRIBUTION_VERSION: '30'
84
85 .fedora:31:
86   extends: .fdo.distribution-image@fedora
87   variables:
88     FDO_DISTRIBUTION_TAG: '2020-03-17.0'
89     FDO_DISTRIBUTION_VERSION: '31'
90
91 .ubuntu:19.10:
92   extends: .fdo.distribution-image@ubuntu
93   variables:
94     FDO_DISTRIBUTION_TAG: '2020-03-17.0'
95     FDO_DISTRIBUTION_VERSION: '19.10'
96
97 .ubuntu:19.04:
98   extends: .fdo.distribution-image@ubuntu
99   variables:
100     FDO_DISTRIBUTION_TAG: '2020-03-17.0'
101     FDO_DISTRIBUTION_VERSION: '19.04'
102
103 .debian:stable:
104   extends: .fdo.distribution-image@debian
105   variables:
106     FDO_DISTRIBUTION_TAG: '2020-03-17.0'
107     FDO_DISTRIBUTION_VERSION: 'stable'
108
109 .debian:sid:
110   extends: .fdo.distribution-image@debian
111   variables:
112     FDO_DISTRIBUTION_TAG: '2020-03-17.0'
113     FDO_DISTRIBUTION_VERSION: 'sid'
114
115 .centos:7:
116   extends: .fdo.distribution-image@centos
117   variables:
118     FDO_DISTRIBUTION_TAG: '2020-03-17.0'
119     FDO_DISTRIBUTION_VERSION: '7'
120
121 .centos:8:
122   extends: .fdo.distribution-image@centos
123   variables:
124     FDO_DISTRIBUTION_TAG: '2020-03-17.0'
125     FDO_DISTRIBUTION_VERSION: '8'
126
127 .arch:rolling:
128   extends: .fdo.distribution-image@arch
129   variables:
130     FDO_DISTRIBUTION_TAG: '2020-03-17.0'
131     FDO_DISTRIBUTION_VERSION: 'rolling'
132
133 .alpine:latest:
134   extends: .fdo.distribution-image@alpine
135   variables:
136     FDO_DISTRIBUTION_TAG: '2020-03-17.0'
137     FDO_DISTRIBUTION_VERSION: 'latest'
138
139
140
141 #################################################################
142 #                                                               #
143 #                          prep stage                           #
144 #                                                               #
145 #################################################################
146
147 # Re-generate the CI script and make sure it's the one currently checked in
148 # If this job fails, re-generate the gitlab-ci.yml script, see
149 # $SRCDIR/.gitlab-ci/generate-gitlab-ci.py
150 #
151 check-ci-script:
152   image: golang:alpine
153   stage: prep
154   before_script:
155     - apk add python3 git
156     - pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
157   script:
158     - ci-fairy generate-template
159     - git diff --exit-code && exit 0 || true
160     - echo "Committed gitlab-ci.yml differs from generated gitlab-ci.yml. Please verify"
161     - exit 1
162
163 check-commit:
164   image: golang:alpine
165   stage: prep
166   before_script:
167     - apk add python3 git
168   script:
169     - pip3 install GitPython
170     - pip3 install pytest
171     - |
172       pytest --junitxml=results.xml \
173              --tb=line \
174              --assert=plain \
175              ./.gitlab-ci/check-commit.py
176   except:
177     - master@libevdev/libevdev
178   variables:
179     GIT_DEPTH: 100
180   artifacts:
181     expire_in: 1 week
182     when: on_failure
183     paths:
184       - results.xml
185     reports:
186       junit: results.xml
187
188 .fedora.packages:
189   variables:
190     FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ meson automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils doxygen xz clang-analyzer'
191
192 .ubuntu.packages:
193   variables:
194     FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkg-config python3 check valgrind binutils doxygen xz-utils'
195
196 .debian.packages:
197   variables:
198     FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkg-config python3 check valgrind binutils doxygen xz-utils'
199
200 .centos.packages:
201   variables:
202     FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils xz'
203
204 .arch.packages:
205   variables:
206     FDO_DISTRIBUTION_PACKAGES: 'git gcc meson automake autoconf libtool make pkgconfig python3 check valgrind binutils doxygen'
207
208 .alpine.packages:
209   variables:
210     FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkgconfig python3 check-dev valgrind binutils doxygen xz linux-headers'
211
212
213 # Pulls in the qemu container from upstream or rebuilds it if missing
214 .fedora:30@qemu-prep:
215   extends:
216     - .fedora:30
217     - .fedora.packages
218     - .fdo.qemu-build@fedora
219   stage: prep
220   tags:
221     - kvm
222   variables:
223     GIT_STRATEGY: none
224     FDO_DISTRIBUTION_TAG: qemu-2020-03-17.0
225   allow_failure: true
226
227 # Always rebuilds the container
228 .fedora:30@qemu-forced-rebuild:
229   extends:
230     - .fedora:30@qemu-prep
231   variables:
232     FDO_FORCE_REBUILD: 1
233   only:
234     - schedules
235
236 # Pulls in the qemu container from upstream or rebuilds it if missing
237 .fedora:31@qemu-prep:
238   extends:
239     - .fedora:31
240     - .fedora.packages
241     - .fdo.qemu-build@fedora
242   stage: prep
243   tags:
244     - kvm
245   variables:
246     GIT_STRATEGY: none
247     FDO_DISTRIBUTION_TAG: qemu-2020-03-17.0
248   allow_failure: true
249
250 # Always rebuilds the container
251 .fedora:31@qemu-forced-rebuild:
252   extends:
253     - .fedora:31@qemu-prep
254   variables:
255     FDO_FORCE_REBUILD: 1
256   only:
257     - schedules
258
259
260 # This is the actual job
261 fedora:31@qemu-prep:
262   extends: .fedora:31@qemu-prep
263
264 fedora:31@qemu-forced-rebuild:
265   extends: .fedora:31@qemu-forced-rebuild
266
267
268 # Pulls in the container from upstream or rebuilds it if missing
269 fedora:30@container-prep:
270   extends:
271     - .fedora:30
272     - .fedora.packages
273     - .fdo.container-build@fedora
274   stage: prep
275   variables:
276     GIT_STRATEGY: none
277
278 # Always rebuilds the container
279 fedora:30@container-forced-rebuild:
280   extends:
281     - fedora:30@container-prep
282   only:
283     - schedules
284   variables:
285     FDO_FORCE_REBUILD: 1
286
287
288 # Pulls in the container from upstream or rebuilds it if missing
289 fedora:31@container-prep:
290   extends:
291     - .fedora:31
292     - .fedora.packages
293     - .fdo.container-build@fedora
294   stage: prep
295   variables:
296     GIT_STRATEGY: none
297
298 # Always rebuilds the container
299 fedora:31@container-forced-rebuild:
300   extends:
301     - fedora:31@container-prep
302   only:
303     - schedules
304   variables:
305     FDO_FORCE_REBUILD: 1
306
307
308 # Pulls in the container from upstream or rebuilds it if missing
309 ubuntu:19.10@container-prep:
310   extends:
311     - .ubuntu:19.10
312     - .ubuntu.packages
313     - .fdo.container-build@ubuntu
314   stage: prep
315   variables:
316     GIT_STRATEGY: none
317
318 # Always rebuilds the container
319 ubuntu:19.10@container-forced-rebuild:
320   extends:
321     - ubuntu:19.10@container-prep
322   only:
323     - schedules
324   variables:
325     FDO_FORCE_REBUILD: 1
326
327
328 # Pulls in the container from upstream or rebuilds it if missing
329 ubuntu:19.04@container-prep:
330   extends:
331     - .ubuntu:19.04
332     - .ubuntu.packages
333     - .fdo.container-build@ubuntu
334   stage: prep
335   variables:
336     GIT_STRATEGY: none
337
338 # Always rebuilds the container
339 ubuntu:19.04@container-forced-rebuild:
340   extends:
341     - ubuntu:19.04@container-prep
342   only:
343     - schedules
344   variables:
345     FDO_FORCE_REBUILD: 1
346
347
348 # Pulls in the container from upstream or rebuilds it if missing
349 debian:stable@container-prep:
350   extends:
351     - .debian:stable
352     - .debian.packages
353     - .fdo.container-build@debian
354   stage: prep
355   variables:
356     GIT_STRATEGY: none
357
358 # Always rebuilds the container
359 debian:stable@container-forced-rebuild:
360   extends:
361     - debian:stable@container-prep
362   only:
363     - schedules
364   variables:
365     FDO_FORCE_REBUILD: 1
366
367
368 # Pulls in the container from upstream or rebuilds it if missing
369 debian:sid@container-prep:
370   extends:
371     - .debian:sid
372     - .debian.packages
373     - .fdo.container-build@debian
374   stage: prep
375   variables:
376     GIT_STRATEGY: none
377
378 # Always rebuilds the container
379 debian:sid@container-forced-rebuild:
380   extends:
381     - debian:sid@container-prep
382   only:
383     - schedules
384   variables:
385     FDO_FORCE_REBUILD: 1
386
387
388 # Pulls in the container from upstream or rebuilds it if missing
389 centos:7@container-prep:
390   extends:
391     - .centos:7
392     - .centos.packages
393     - .fdo.container-build@centos
394   stage: prep
395   variables:
396     GIT_STRATEGY: none
397
398 # Always rebuilds the container
399 centos:7@container-forced-rebuild:
400   extends:
401     - centos:7@container-prep
402   only:
403     - schedules
404   variables:
405     FDO_FORCE_REBUILD: 1
406
407
408 # Pulls in the container from upstream or rebuilds it if missing
409 centos:8@container-prep:
410   extends:
411     - .centos:8
412     - .centos.packages
413     - .fdo.container-build@centos
414   stage: prep
415   variables:
416     GIT_STRATEGY: none
417
418 # Always rebuilds the container
419 centos:8@container-forced-rebuild:
420   extends:
421     - centos:8@container-prep
422   only:
423     - schedules
424   variables:
425     FDO_FORCE_REBUILD: 1
426
427
428 # Pulls in the container from upstream or rebuilds it if missing
429 arch:rolling@container-prep:
430   extends:
431     - .arch:rolling
432     - .arch.packages
433     - .fdo.container-build@arch
434   stage: prep
435   variables:
436     GIT_STRATEGY: none
437
438 # Always rebuilds the container
439 arch:rolling@container-forced-rebuild:
440   extends:
441     - arch:rolling@container-prep
442   only:
443     - schedules
444   variables:
445     FDO_FORCE_REBUILD: 1
446
447
448 # Pulls in the container from upstream or rebuilds it if missing
449 alpine:latest@container-prep:
450   extends:
451     - .alpine:latest
452     - .alpine.packages
453     - .fdo.container-build@alpine
454   stage: prep
455   variables:
456     GIT_STRATEGY: none
457
458 # Always rebuilds the container
459 alpine:latest@container-forced-rebuild:
460   extends:
461     - alpine:latest@container-prep
462   only:
463     - schedules
464   variables:
465     FDO_FORCE_REBUILD: 1
466
467
468 #################################################################
469 #                                                               #
470 #                   container clean stage                       #
471 #                 run during the clean stage                    #
472 #                                                               #
473 #################################################################
474
475 #
476 # This stage will look for the container images we currently have in
477 # the registry and will remove any that are not tagged with the provided
478 # $container_image:$tag
479 .container-clean:
480   stage: container_clean
481   image: golang:alpine
482   before_script:
483     - apk add python3 git
484     - pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
485   script:
486     # Go to your Profile, Settings, Access Tokens
487     # Create a personal token with 'api' scope, copy the value.
488     # Go to CI/CD, Schedules, schedule a new monthly job (or edit the existing one)
489     # Define a variable of type File named AUTHFILE. Content is that token
490     # value.
491     - ci-fairy -v --authfile $AUTHFILE delete-image
492             --repository $FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION
493             --exclude-tag $FDO_DISTRIBUTION_TAG
494   dependencies: []
495   allow_failure: true
496   only:
497     - schedules
498
499 ### fedora 30
500 fedora:30@container-clean:
501   extends:
502     - .fedora:30
503     - .container-clean
504   needs: ["fedora:30@container-prep"]
505
506 ### fedora 31
507 fedora:31@container-clean:
508   extends:
509     - .fedora:31
510     - .container-clean
511   needs: ["fedora:31@container-prep"]
512
513 ### ubuntu 19.10
514 ubuntu:19.10@container-clean:
515   extends:
516     - .ubuntu:19.10
517     - .container-clean
518   needs: ["ubuntu:19.10@container-prep"]
519
520 ### ubuntu 19.04
521 ubuntu:19.04@container-clean:
522   extends:
523     - .ubuntu:19.04
524     - .container-clean
525   needs: ["ubuntu:19.04@container-prep"]
526
527 ### debian stable
528 debian:stable@container-clean:
529   extends:
530     - .debian:stable
531     - .container-clean
532   needs: ["debian:stable@container-prep"]
533
534 ### debian sid
535 debian:sid@container-clean:
536   extends:
537     - .debian:sid
538     - .container-clean
539   needs: ["debian:sid@container-prep"]
540
541 ### centos 7
542 centos:7@container-clean:
543   extends:
544     - .centos:7
545     - .container-clean
546   needs: ["centos:7@container-prep"]
547
548 ### centos 8
549 centos:8@container-clean:
550   extends:
551     - .centos:8
552     - .container-clean
553   needs: ["centos:8@container-prep"]
554
555 ### arch rolling
556 arch:rolling@container-clean:
557   extends:
558     - .arch:rolling
559     - .container-clean
560   needs: ["arch:rolling@container-prep"]
561
562 ### alpine latest
563 alpine:latest@container-clean:
564   extends:
565     - .alpine:latest
566     - .container-clean
567   needs: ["alpine:latest@container-prep"]
568
569
570 #################################################################
571 #                                                               #
572 #                       build stage                             #
573 #                                                               #
574 #################################################################
575
576 .autotools-build@template:
577   extends:
578     - .autotools_build
579   stage: build
580   dependencies: []
581   variables:
582     MAKE_ARGS: "distcheck"
583
584 .meson-build@template:
585   extends:
586     - .meson_build
587   stage: build
588   dependencies: []
589   variables:
590     NINJA_ARGS: "dist"
591
592
593 fedora:30@autotools-build:
594   extends:
595     - .fedora:30
596     - .autotools-build@template
597   stage: autotools
598   needs: ['fedora:30@container-prep']
599
600 fedora:30@meson-build:
601   extends:
602     - .fedora:30
603     - .meson-build@template
604   stage: meson
605   needs: ['fedora:30@container-prep']
606
607
608 fedora:31@autotools-build:
609   extends:
610     - .fedora:31
611     - .autotools-build@template
612   stage: autotools
613   needs: ['fedora:31@container-prep']
614
615 fedora:31@meson-build:
616   extends:
617     - .fedora:31
618     - .meson-build@template
619   stage: meson
620   needs: ['fedora:31@container-prep']
621
622
623 ubuntu:19.10@autotools-build:
624   extends:
625     - .ubuntu:19.10
626     - .autotools-build@template
627   stage: autotools
628   needs: ['ubuntu:19.10@container-prep']
629
630 ubuntu:19.10@meson-build:
631   extends:
632     - .ubuntu:19.10
633     - .meson-build@template
634   stage: meson
635   needs: ['ubuntu:19.10@container-prep']
636
637
638 ubuntu:19.04@autotools-build:
639   extends:
640     - .ubuntu:19.04
641     - .autotools-build@template
642   stage: autotools
643   needs: ['ubuntu:19.04@container-prep']
644
645 ubuntu:19.04@meson-build:
646   extends:
647     - .ubuntu:19.04
648     - .meson-build@template
649   stage: meson
650   needs: ['ubuntu:19.04@container-prep']
651
652
653 debian:stable@autotools-build:
654   extends:
655     - .debian:stable
656     - .autotools-build@template
657   stage: autotools
658   needs: ['debian:stable@container-prep']
659
660 debian:stable@meson-build:
661   extends:
662     - .debian:stable
663     - .meson-build@template
664   stage: meson
665   needs: ['debian:stable@container-prep']
666
667
668 debian:sid@autotools-build:
669   extends:
670     - .debian:sid
671     - .autotools-build@template
672   stage: autotools
673   needs: ['debian:sid@container-prep']
674
675 debian:sid@meson-build:
676   extends:
677     - .debian:sid
678     - .meson-build@template
679   stage: meson
680   needs: ['debian:sid@container-prep']
681
682
683 centos:7@autotools-build:
684   extends:
685     - .centos:7
686     - .autotools-build@template
687   stage: autotools
688   variables:
689     MAKE_ARGS: ''  # disable distcheck, requires doxygen
690   needs: ['centos:7@container-prep']
691
692
693
694 centos:8@autotools-build:
695   extends:
696     - .centos:8
697     - .autotools-build@template
698   stage: autotools
699   variables:
700     MAKE_ARGS: ''  # disable distcheck, requires doxygen
701   needs: ['centos:8@container-prep']
702
703
704
705 arch:rolling@autotools-build:
706   extends:
707     - .arch:rolling
708     - .autotools-build@template
709   stage: autotools
710   needs: ['arch:rolling@container-prep']
711
712 arch:rolling@meson-build:
713   extends:
714     - .arch:rolling
715     - .meson-build@template
716   stage: meson
717   needs: ['arch:rolling@container-prep']
718
719
720 alpine:latest@autotools-build:
721   extends:
722     - .alpine:latest
723     - .autotools-build@template
724   stage: autotools
725   needs: ['alpine:latest@container-prep']
726
727 alpine:latest@meson-build:
728   extends:
729     - .alpine:latest
730     - .meson-build@template
731   stage: meson
732   needs: ['alpine:latest@container-prep']
733
734
735 # Build argument tests
736 #
737 # We only run the build option combinations on one image
738 # because they're supposed to fail equally on all
739 .fedora-custom-build@autotools-template:
740   extends:
741     - .fedora:31
742     - .autotools-build@template
743   stage: build
744   needs: ['fedora:31@container-prep']
745
746 no-valgrind:autotools:
747   extends: .fedora-custom-build@autotools-template
748   before_script:
749     - dnf remove -y valgrind
750
751 no-check:autotools:
752   extends: .fedora-custom-build@autotools-template
753   before_script:
754     - dnf remove -y check check-devel
755
756 no-doxygen:autotools:
757   extends: .fedora-custom-build@autotools-template
758   before_script:
759     - dnf remove -y doxygen
760   variables:
761     MAKE_ARGS: ''  # disable distcheck, requires doxygen
762
763 # doxygen is required for distcheck
764 no-doxygen-check-valgrind:autotools:
765   extends: .fedora-custom-build@autotools-template
766   before_script:
767     - dnf remove -y doxygen valgrind check check-devel
768   variables:
769     MAKE_ARGS: ''  # disable distcheck, requires doxygen
770
771 no-nm:autotools:
772   extends: .fedora-custom-build@autotools-template
773   before_script:
774     - mv /usr/bin/nm /usr/bin/nm.moved
775
776 enable-gcov:autotools:
777   extends: .fedora-custom-build@autotools-template
778   variables:
779     CONFIGURE_FLAGS: "--enable-gcov"
780
781 .fedora-custom-build@meson-template:
782   extends:
783     - .fedora:31
784     - .meson-build@template
785   stage: build
786   needs: ['fedora:31@container-prep']
787
788 no-valgrind:meson:
789   extends: .fedora-custom-build@meson-template
790   before_script:
791     - dnf remove -y valgrind
792
793 no-check:meson:
794   extends: .fedora-custom-build@meson-template
795   before_script:
796     - dnf remove -y check check-devel
797   variables:
798     MESON_ARGS: -Dtests=disabled
799     SKIP_MESON_TEST: 1
800
801 # doxygen is required for dist
802 no-doxygen:meson:
803   extends: .fedora-custom-build@meson-template
804   before_script:
805     - dnf remove -y doxygen
806   variables:
807     MESON_ARGS: -Ddocumentation=disabled
808     NINJA_ARGS: ''
809
810 # doxygen is required for dist
811 no-doxygen-check-valgrind:meson:
812   extends: .fedora-custom-build@meson-template
813   before_script:
814     - dnf remove -y doxygen valgrind check check-devel
815   variables:
816     MESON_ARGS: -Dtests=disabled -Ddocumentation=disabled
817     NINJA_ARGS: ''
818     SKIP_MESON_TEST: 1
819
820 enable-gcov:meson:
821   extends: .fedora-custom-build@meson-template
822   variables:
823     MESON_ARGS: '-Dcoverity=true'
824
825 scan-build:meson:
826   extends: .fedora-custom-build@meson-template
827   variables:
828     NINJA_ARGS: 'scan-build'
829     SKIP_MESON_TEST: 1
830
831 static-build:meson:
832   extends: .fedora-custom-build@meson-template
833   script:
834     - meson "$MESON_BUILDDIR" --default-library=static --prefix=$PWD/prefix-meson/
835     - ninja -C "$MESON_BUILDDIR" install
836     - ls -l $PWD/prefix-meson/lib64/libevdev.a
837
838 soname:
839   extends:
840     - .fedora:31
841   stage: build
842   script:
843   - ./autogen.sh --prefix=$PWD/prefix-autotools/
844   - make install
845   - ls -l $PWD/prefix-autotools/lib/libevdev.so.2.3.0
846   - meson "$MESON_BUILDDIR" --prefix=$PWD/prefix-meson/
847   - ninja -C "$MESON_BUILDDIR" install
848   - ls -l $PWD/prefix-meson/lib64/libevdev.so.2.3.0
849   needs: ['fedora:31@container-prep']
850
851 #################################################################
852 #                                                               #
853 #                          VM stage                             #
854 #                                                               #
855 #################################################################
856
857 .check_tainted: &check_tainted |
858   # make sure the kernel is not tainted
859   if [[ "$(ssh localhost -p 5555 cat /proc/sys/kernel/tainted)" -gt 0 ]];
860   then
861     echo tainted kernel ;
862     exit 1 ;
863   fi
864
865 .qemu@fedora:31:
866   extends:
867     - .fedora:31
868   stage: VM
869   image: $CI_REGISTRY_IMAGE/$FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION:qemu-$FDO_DISTRIBUTION_TAG
870   tags:
871     - kvm
872   variables:
873     MESON_BUILDDIR: build_dir
874   script:
875     # start our vm, no args required
876     - /app/start_vm.sh
877
878     - *check_tainted
879
880     - "scp -P 5555 -r $PWD localhost:"
881     - echo "CI_JOB_ID=\"$CI_JOB_ID\"" > sshenv
882     - echo "CI_JOB_NAME=\"$CI_JOB_NAME\"" >> sshenv
883     - echo "MESON_BUILDDIR=\"$MESON_BUILDDIR\"" >> sshenv
884     - echo "MESON_TEST_ARGS=\"$MESON_TEST_ARGS\"" >> sshenv
885     - echo "NINJA_ARGS=\"$NINJA_ARGS\"" >> sshenv
886     - "scp -P 5555 sshenv localhost:~/$CI_PROJECT_NAME/.meson_environment"
887     - ssh localhost -p 5555 "cd $CI_PROJECT_NAME ; .gitlab-ci/meson-build.sh" && touch .success || true
888     # no matter the results of the tests, we want to fetch the logs
889     - scp -P 5555 -r localhost:$CI_PROJECT_NAME/"$MESON_BUILDDIR" .
890
891     - *check_tainted
892
893     - ssh localhost -p 5555 halt || true
894     - sleep 2
895     - pkill qemu || true
896
897     - if [[ ! -e .success ]] ;
898       then
899         exit 1 ;
900       fi
901   artifacts:
902     name: "qemu-meson-logs-$CI_JOB_NAME"
903     when: always
904     expire_in: 1 week
905     paths:
906       - $MESON_BUILDDIR/meson-logs
907       - console.out
908     reports:
909       junit: $MESON_BUILDDIR/junit-*.xml
910
911   retry:
912     max: 2
913     when: script_failure
914   needs: ['fedora:31@qemu-prep']
915
916 qemu:meson:
917   extends: .qemu@fedora:31
918
919 qemu:meson:valgrind:
920   extends: .qemu@fedora:31
921   variables:
922     MESON_TEST_ARGS: '--setup=valgrind'
923
924 meson-from-tarball:
925   extends:
926     - .fedora:31
927   stage: tarballs
928   script:
929     - export INSTALLDIR="$PWD/_inst"
930     - mkdir _build
931     - pushd _build > /dev/null
932     - ../autogen.sh --disable-silent-rules $CONFIGURE_FLAGS
933     - make
934     - make distcheck
935     - popd > /dev/null
936     - mkdir -p _tarball_dir
937     - tar xf _build/libevdev-*.tar.xz -C _tarball_dir
938     - pushd _tarball_dir/libevdev-*/ > /dev/null
939     - meson "$MESON_BUILDDIR" --prefix="$INSTALLDIR"
940     - ninja -C "$MESON_BUILDDIR" test
941     - ninja -C "$MESON_BUILDDIR" install
942     - popd > /dev/null
943     - ls -lR $INSTALLDIR
944   needs: ['fedora:31@container-prep']
945
946 autotools-from-tarball:
947   extends:
948     - .fedora:31
949   stage: tarballs
950   script:
951     - export INSTALLDIR="$PWD/_inst"
952     - meson "$MESON_BUILDDIR"
953     - ninja -C "$MESON_BUILDDIR" dist
954     - mkdir -p _tarball_dir
955     - tar xf "$MESON_BUILDDIR"/meson-dist/libevdev-*.xz -C _tarball_dir
956     - pushd _tarball_dir/libevdev-*/ > /dev/null
957     - mkdir _build
958     - pushd _build > /dev/null
959     - ../autogen.sh --disable-silent-rules --prefix="$INSTALLDIR" $CONFIGURE_FLAGS
960     - make
961     - make install
962     - make distcheck
963     - popd > /dev/null
964     - popd > /dev/null
965     - ls -lR $INSTALLDIR
966   needs: ['fedora:31@container-prep']