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