gitlab CI: use the new templates with a single job only
[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 d32ac1f30faad4fdef24af8a7724fb8c084c3dda # 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 --user jinja2 PyYAML
157   script:
158     - python3 ./.gitlab-ci/generate-gitlab-ci.py
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
484     - pip3 install --user python-gitlab
485   script:
486     - LATEST_TAG=$(echo $DISTRO_CONTAINER_IMAGE | cut -f2 -d:)
487     # Go to your Profile, Settings, Access Tokens
488     # Create a personal token with 'api' scope, copy the value.
489     # Go to Settings, CI/CD, Variables
490     # Define a variable of type File named AUTHFILE. Content is that token
491     # value.
492     - python3 .gitlab-ci/gitlab-container-delete $CI_SERVER_URL $CI_PROJECT_PATH
493             --repository $FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION
494             --authfile $AUTHFILE --exclude-tag "$LATEST_TAG"
495   dependencies: []
496   allow_failure: true
497   only:
498     - schedules
499
500 ### fedora 30
501 fedora:30@container-clean:
502   extends:
503     - .fedora:30
504     - .container-clean
505   needs: ["fedora:30@container-prep"]
506
507 ### fedora 31
508 fedora:31@container-clean:
509   extends:
510     - .fedora:31
511     - .container-clean
512   needs: ["fedora:31@container-prep"]
513
514 ### ubuntu 19.10
515 ubuntu:19.10@container-clean:
516   extends:
517     - .ubuntu:19.10
518     - .container-clean
519   needs: ["ubuntu:19.10@container-prep"]
520
521 ### ubuntu 19.04
522 ubuntu:19.04@container-clean:
523   extends:
524     - .ubuntu:19.04
525     - .container-clean
526   needs: ["ubuntu:19.04@container-prep"]
527
528 ### debian stable
529 debian:stable@container-clean:
530   extends:
531     - .debian:stable
532     - .container-clean
533   needs: ["debian:stable@container-prep"]
534
535 ### debian sid
536 debian:sid@container-clean:
537   extends:
538     - .debian:sid
539     - .container-clean
540   needs: ["debian:sid@container-prep"]
541
542 ### centos 7
543 centos:7@container-clean:
544   extends:
545     - .centos:7
546     - .container-clean
547   needs: ["centos:7@container-prep"]
548
549 ### centos 8
550 centos:8@container-clean:
551   extends:
552     - .centos:8
553     - .container-clean
554   needs: ["centos:8@container-prep"]
555
556 ### arch rolling
557 arch:rolling@container-clean:
558   extends:
559     - .arch:rolling
560     - .container-clean
561   needs: ["arch:rolling@container-prep"]
562
563 ### alpine latest
564 alpine:latest@container-clean:
565   extends:
566     - .alpine:latest
567     - .container-clean
568   needs: ["alpine:latest@container-prep"]
569
570
571 #################################################################
572 #                                                               #
573 #                       build stage                             #
574 #                                                               #
575 #################################################################
576
577 .autotools-build@template:
578   extends:
579     - .autotools_build
580   stage: build
581   dependencies: []
582   variables:
583     MAKE_ARGS: "distcheck"
584
585 .meson-build@template:
586   extends:
587     - .meson_build
588   stage: build
589   dependencies: []
590   variables:
591     NINJA_ARGS: "dist"
592
593
594 fedora:30@autotools-build:
595   extends:
596     - .fedora:30
597     - .autotools-build@template
598   stage: autotools
599   needs: ['fedora:30@container-prep']
600
601 fedora:30@meson-build:
602   extends:
603     - .fedora:30
604     - .meson-build@template
605   stage: meson
606   needs: ['fedora:30@container-prep']
607
608
609 fedora:31@autotools-build:
610   extends:
611     - .fedora:31
612     - .autotools-build@template
613   stage: autotools
614   needs: ['fedora:31@container-prep']
615
616 fedora:31@meson-build:
617   extends:
618     - .fedora:31
619     - .meson-build@template
620   stage: meson
621   needs: ['fedora:31@container-prep']
622
623
624 ubuntu:19.10@autotools-build:
625   extends:
626     - .ubuntu:19.10
627     - .autotools-build@template
628   stage: autotools
629   needs: ['ubuntu:19.10@container-prep']
630
631 ubuntu:19.10@meson-build:
632   extends:
633     - .ubuntu:19.10
634     - .meson-build@template
635   stage: meson
636   needs: ['ubuntu:19.10@container-prep']
637
638
639 ubuntu:19.04@autotools-build:
640   extends:
641     - .ubuntu:19.04
642     - .autotools-build@template
643   stage: autotools
644   needs: ['ubuntu:19.04@container-prep']
645
646 ubuntu:19.04@meson-build:
647   extends:
648     - .ubuntu:19.04
649     - .meson-build@template
650   stage: meson
651   needs: ['ubuntu:19.04@container-prep']
652
653
654 debian:stable@autotools-build:
655   extends:
656     - .debian:stable
657     - .autotools-build@template
658   stage: autotools
659   needs: ['debian:stable@container-prep']
660
661 debian:stable@meson-build:
662   extends:
663     - .debian:stable
664     - .meson-build@template
665   stage: meson
666   needs: ['debian:stable@container-prep']
667
668
669 debian:sid@autotools-build:
670   extends:
671     - .debian:sid
672     - .autotools-build@template
673   stage: autotools
674   needs: ['debian:sid@container-prep']
675
676 debian:sid@meson-build:
677   extends:
678     - .debian:sid
679     - .meson-build@template
680   stage: meson
681   needs: ['debian:sid@container-prep']
682
683
684 centos:7@autotools-build:
685   extends:
686     - .centos:7
687     - .autotools-build@template
688   stage: autotools
689   variables:
690     MAKE_ARGS: ''  # disable distcheck, requires doxygen
691   needs: ['centos:7@container-prep']
692
693
694
695 centos:8@autotools-build:
696   extends:
697     - .centos:8
698     - .autotools-build@template
699   stage: autotools
700   variables:
701     MAKE_ARGS: ''  # disable distcheck, requires doxygen
702   needs: ['centos:8@container-prep']
703
704
705
706 arch:rolling@autotools-build:
707   extends:
708     - .arch:rolling
709     - .autotools-build@template
710   stage: autotools
711   needs: ['arch:rolling@container-prep']
712
713 arch:rolling@meson-build:
714   extends:
715     - .arch:rolling
716     - .meson-build@template
717   stage: meson
718   needs: ['arch:rolling@container-prep']
719
720
721 alpine:latest@autotools-build:
722   extends:
723     - .alpine:latest
724     - .autotools-build@template
725   stage: autotools
726   needs: ['alpine:latest@container-prep']
727
728 alpine:latest@meson-build:
729   extends:
730     - .alpine:latest
731     - .meson-build@template
732   stage: meson
733   needs: ['alpine:latest@container-prep']
734
735
736 # Build argument tests
737 #
738 # We only run the build option combinations on one image
739 # because they're supposed to fail equally on all
740 .fedora-custom-build@autotools-template:
741   extends:
742     - .fedora:31
743     - .autotools-build@template
744   stage: build
745   needs: ['fedora:31@container-prep']
746
747 no-valgrind:autotools:
748   extends: .fedora-custom-build@autotools-template
749   before_script:
750     - dnf remove -y valgrind
751
752 no-check:autotools:
753   extends: .fedora-custom-build@autotools-template
754   before_script:
755     - dnf remove -y check check-devel
756
757 no-doxygen:autotools:
758   extends: .fedora-custom-build@autotools-template
759   before_script:
760     - dnf remove -y doxygen
761   variables:
762     MAKE_ARGS: ''  # disable distcheck, requires doxygen
763
764 # doxygen is required for distcheck
765 no-doxygen-check-valgrind:autotools:
766   extends: .fedora-custom-build@autotools-template
767   before_script:
768     - dnf remove -y doxygen valgrind check check-devel
769   variables:
770     MAKE_ARGS: ''  # disable distcheck, requires doxygen
771
772 no-nm:autotools:
773   extends: .fedora-custom-build@autotools-template
774   before_script:
775     - mv /usr/bin/nm /usr/bin/nm.moved
776
777 enable-gcov:autotools:
778   extends: .fedora-custom-build@autotools-template
779   variables:
780     CONFIGURE_FLAGS: "--enable-gcov"
781
782 .fedora-custom-build@meson-template:
783   extends:
784     - .fedora:31
785     - .meson-build@template
786   stage: build
787   needs: ['fedora:31@container-prep']
788
789 no-valgrind:meson:
790   extends: .fedora-custom-build@meson-template
791   before_script:
792     - dnf remove -y valgrind
793
794 no-check:meson:
795   extends: .fedora-custom-build@meson-template
796   before_script:
797     - dnf remove -y check check-devel
798   variables:
799     MESON_ARGS: -Dtests=disabled
800     SKIP_MESON_TEST: 1
801
802 # doxygen is required for dist
803 no-doxygen:meson:
804   extends: .fedora-custom-build@meson-template
805   before_script:
806     - dnf remove -y doxygen
807   variables:
808     MESON_ARGS: -Ddocumentation=disabled
809     NINJA_ARGS: ''
810
811 # doxygen is required for dist
812 no-doxygen-check-valgrind:meson:
813   extends: .fedora-custom-build@meson-template
814   before_script:
815     - dnf remove -y doxygen valgrind check check-devel
816   variables:
817     MESON_ARGS: -Dtests=disabled -Ddocumentation=disabled
818     NINJA_ARGS: ''
819     SKIP_MESON_TEST: 1
820
821 enable-gcov:meson:
822   extends: .fedora-custom-build@meson-template
823   variables:
824     MESON_ARGS: '-Dcoverity=true'
825
826 scan-build:meson:
827   extends: .fedora-custom-build@meson-template
828   variables:
829     NINJA_ARGS: 'scan-build'
830     SKIP_MESON_TEST: 1
831
832 static-build:meson:
833   extends: .fedora-custom-build@meson-template
834   script:
835     - meson "$MESON_BUILDDIR" --default-library=static --prefix=$PWD/prefix-meson/
836     - ninja -C "$MESON_BUILDDIR" install
837     - ls -l $PWD/prefix-meson/lib64/libevdev.a
838
839 soname:
840   extends:
841     - .fedora:31
842   stage: build
843   script:
844   - ./autogen.sh --prefix=$PWD/prefix-autotools/
845   - make install
846   - ls -l $PWD/prefix-autotools/lib/libevdev.so.2.3.0
847   - meson "$MESON_BUILDDIR" --prefix=$PWD/prefix-meson/
848   - ninja -C "$MESON_BUILDDIR" install
849   - ls -l $PWD/prefix-meson/lib64/libevdev.so.2.3.0
850   needs: ['fedora:31@container-prep']
851
852 #################################################################
853 #                                                               #
854 #                          VM stage                             #
855 #                                                               #
856 #################################################################
857
858 .check_tainted: &check_tainted |
859   # make sure the kernel is not tainted
860   if [[ "$(ssh localhost -p 5555 cat /proc/sys/kernel/tainted)" -gt 0 ]];
861   then
862     echo tainted kernel ;
863     exit 1 ;
864   fi
865
866 .qemu@fedora:31:
867   extends:
868     - .fedora:31
869   stage: VM
870   image: $CI_REGISTRY_IMAGE/$FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION:qemu-$FDO_DISTRIBUTION_TAG
871   tags:
872     - kvm
873   variables:
874     MESON_BUILDDIR: build_dir
875   script:
876     # start our vm, no args required
877     - /app/start_vm.sh
878
879     - *check_tainted
880
881     - "scp -P 5555 -r $PWD localhost:"
882     - echo "CI_JOB_ID=\"$CI_JOB_ID\"" > sshenv
883     - echo "CI_JOB_NAME=\"$CI_JOB_NAME\"" >> sshenv
884     - echo "MESON_BUILDDIR=\"$MESON_BUILDDIR\"" >> sshenv
885     - echo "MESON_TEST_ARGS=\"$MESON_TEST_ARGS\"" >> sshenv
886     - echo "NINJA_ARGS=\"$NINJA_ARGS\"" >> sshenv
887     - "scp -P 5555 sshenv localhost:~/$CI_PROJECT_NAME/.meson_environment"
888     - ssh localhost -p 5555 "cd $CI_PROJECT_NAME ; .gitlab-ci/meson-build.sh" && touch .success || true
889     # no matter the results of the tests, we want to fetch the logs
890     - scp -P 5555 -r localhost:$CI_PROJECT_NAME/"$MESON_BUILDDIR" .
891
892     - *check_tainted
893
894     - ssh localhost -p 5555 halt || true
895     - sleep 2
896     - pkill qemu || true
897
898     - if [[ ! -e .success ]] ;
899       then
900         exit 1 ;
901       fi
902   artifacts:
903     name: "qemu-meson-logs-$CI_JOB_NAME"
904     when: always
905     expire_in: 1 week
906     paths:
907       - $MESON_BUILDDIR/meson-logs
908       - console.out
909     reports:
910       junit: $MESON_BUILDDIR/junit-*.xml
911
912   retry:
913     max: 2
914     when: script_failure
915   needs: ['fedora:31@qemu-prep']
916
917 qemu:meson:
918   extends: .qemu@fedora:31
919
920 qemu:meson:valgrind:
921   extends: .qemu@fedora:31
922   variables:
923     MESON_TEST_ARGS: '--setup=valgrind'
924
925 meson-from-tarball:
926   extends:
927     - .fedora:31
928   stage: tarballs
929   script:
930     - export INSTALLDIR="$PWD/_inst"
931     - mkdir _build
932     - pushd _build > /dev/null
933     - ../autogen.sh --disable-silent-rules $CONFIGURE_FLAGS
934     - make
935     - make distcheck
936     - popd > /dev/null
937     - mkdir -p _tarball_dir
938     - tar xf _build/libevdev-*.tar.xz -C _tarball_dir
939     - pushd _tarball_dir/libevdev-*/ > /dev/null
940     - meson "$MESON_BUILDDIR" --prefix="$INSTALLDIR"
941     - ninja -C "$MESON_BUILDDIR" test
942     - ninja -C "$MESON_BUILDDIR" install
943     - popd > /dev/null
944     - ls -lR $INSTALLDIR
945   needs: ['fedora:31@container-prep']
946
947 autotools-from-tarball:
948   extends:
949     - .fedora:31
950   stage: tarballs
951   script:
952     - export INSTALLDIR="$PWD/_inst"
953     - meson "$MESON_BUILDDIR"
954     - ninja -C "$MESON_BUILDDIR" dist
955     - mkdir -p _tarball_dir
956     - tar xf "$MESON_BUILDDIR"/meson-dist/libevdev-*.xz -C _tarball_dir
957     - pushd _tarball_dir/libevdev-*/ > /dev/null
958     - mkdir _build
959     - pushd _build > /dev/null
960     - ../autogen.sh --disable-silent-rules --prefix="$INSTALLDIR" $CONFIGURE_FLAGS
961     - make
962     - make install
963     - make distcheck
964     - popd > /dev/null
965     - popd > /dev/null
966     - ls -lR $INSTALLDIR
967   needs: ['fedora:31@container-prep']