gitlab CI: Use the new fdo CI templates distribution images
[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 2469555cd0a6b621b988e100ddd746c2ad0cdd1d # 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-06.0'
83     FDO_DISTRIBUTION_VERSION: '30'
84
85 .fedora:31:
86   extends: .fdo.distribution_image@fedora
87   variables:
88     FDO_DISTRIBUTION_TAG: '2020-03-06.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-06.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-06.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-06.0'
107     FDO_DISTRIBUTION_VERSION: 'stable'
108
109 .debian:sid:
110   extends: .fdo.distribution_image@debian
111   variables:
112     FDO_DISTRIBUTION_TAG: '2020-03-06.0'
113     FDO_DISTRIBUTION_VERSION: 'sid'
114
115 .centos:7:
116   extends: .fdo.distribution_image@centos
117   variables:
118     FDO_DISTRIBUTION_TAG: '2020-03-06.0'
119     FDO_DISTRIBUTION_VERSION: '7'
120
121 .centos:8:
122   extends: .fdo.distribution_image@centos
123   variables:
124     FDO_DISTRIBUTION_TAG: '2020-03-06.0'
125     FDO_DISTRIBUTION_VERSION: '8'
126
127 .arch:rolling:
128   extends: .fdo.distribution_image@arch
129   variables:
130     FDO_DISTRIBUTION_TAG: '2020-03-06.0'
131     FDO_DISTRIBUTION_VERSION: 'rolling'
132
133 .alpine:latest:
134   extends: .fdo.distribution_image@alpine
135   variables:
136     FDO_DISTRIBUTION_TAG: '2020-03-06.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 .pull_upstream_or_rebuild:
189   before_script:
190     # log in to the registry
191     - podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
192
193     # get the full container image name (FDO_DISTRIBUTION_VERSION still has indirections)
194     - IMAGE=$(eval echo "$FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG")
195
196     - |
197       # force rebuild if schedule, reuse otherwise
198       if [[ $CI_PIPELINE_SOURCE != "schedule" ]] ;
199       then
200         # pull the latest upstream image if it exists
201         skopeo copy docker://$CI_REGISTRY/$FDO_UPSTREAM_REPO/$IMAGE \
202                     docker://$CI_REGISTRY_IMAGE/$IMAGE && exit 0 || true ;
203
204         # check if our image is already in the current registry
205         skopeo inspect docker://$CI_REGISTRY_IMAGE/$IMAGE > /dev/null && exit 0 || true ;
206       fi
207
208 .fedora:30@qemu-prep:
209   extends:
210     - .fedora:30
211     - .fdo.qemu-build@fedora
212     - .pull_upstream_or_rebuild
213   stage: prep
214   tags:
215     - kvm
216   variables:
217     GIT_STRATEGY: none
218     FDO_DISTRIBUTION_TAG: qemu-2020-03-06.0
219     FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ meson automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils doxygen xz clang-analyzer'
220   allow_failure: true
221
222 .fedora:31@qemu-prep:
223   extends:
224     - .fedora:31
225     - .fdo.qemu-build@fedora
226     - .pull_upstream_or_rebuild
227   stage: prep
228   tags:
229     - kvm
230   variables:
231     GIT_STRATEGY: none
232     FDO_DISTRIBUTION_TAG: qemu-2020-03-06.0
233     FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ meson automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils doxygen xz clang-analyzer'
234   allow_failure: true
235
236
237 fedora:31@qemu-prep:
238   extends: .fedora:31@qemu-prep
239
240
241 ### fedora 30
242 fedora:30@container-prep:
243   extends:
244     - .fedora:30
245     - .fdo.container-build@fedora
246     - .pull_upstream_or_rebuild
247   stage: prep
248   variables:
249     GIT_STRATEGY: none
250     FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ meson automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils doxygen xz clang-analyzer'
251
252
253 ### fedora 31
254 fedora:31@container-prep:
255   extends:
256     - .fedora:31
257     - .fdo.container-build@fedora
258     - .pull_upstream_or_rebuild
259   stage: prep
260   variables:
261     GIT_STRATEGY: none
262     FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ meson automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils doxygen xz clang-analyzer'
263
264
265 ### ubuntu 19.10
266 ubuntu:19.10@container-prep:
267   extends:
268     - .ubuntu:19.10
269     - .fdo.container-build@ubuntu
270     - .pull_upstream_or_rebuild
271   stage: prep
272   variables:
273     GIT_STRATEGY: none
274     FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkg-config python3 check valgrind binutils doxygen xz-utils'
275
276
277 ### ubuntu 19.04
278 ubuntu:19.04@container-prep:
279   extends:
280     - .ubuntu:19.04
281     - .fdo.container-build@ubuntu
282     - .pull_upstream_or_rebuild
283   stage: prep
284   variables:
285     GIT_STRATEGY: none
286     FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkg-config python3 check valgrind binutils doxygen xz-utils'
287
288
289 ### debian stable
290 debian:stable@container-prep:
291   extends:
292     - .debian:stable
293     - .fdo.container-build@debian
294     - .pull_upstream_or_rebuild
295   stage: prep
296   variables:
297     GIT_STRATEGY: none
298     FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkg-config python3 check valgrind binutils doxygen xz-utils'
299
300
301 ### debian sid
302 debian:sid@container-prep:
303   extends:
304     - .debian:sid
305     - .fdo.container-build@debian
306     - .pull_upstream_or_rebuild
307   stage: prep
308   variables:
309     GIT_STRATEGY: none
310     FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkg-config python3 check valgrind binutils doxygen xz-utils'
311
312
313 ### centos 7
314 centos:7@container-prep:
315   extends:
316     - .centos:7
317     - .fdo.container-build@centos
318     - .pull_upstream_or_rebuild
319   stage: prep
320   variables:
321     GIT_STRATEGY: none
322     FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils xz'
323
324
325 ### centos 8
326 centos:8@container-prep:
327   extends:
328     - .centos:8
329     - .fdo.container-build@centos
330     - .pull_upstream_or_rebuild
331   stage: prep
332   variables:
333     GIT_STRATEGY: none
334     FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils xz'
335
336
337 ### arch rolling
338 arch:rolling@container-prep:
339   extends:
340     - .arch:rolling
341     - .fdo.container-build@arch
342     - .pull_upstream_or_rebuild
343   stage: prep
344   variables:
345     GIT_STRATEGY: none
346     FDO_DISTRIBUTION_PACKAGES: 'git gcc meson automake autoconf libtool make pkgconfig python3 check valgrind binutils doxygen'
347
348
349 ### alpine latest
350 alpine:latest@container-prep:
351   extends:
352     - .alpine:latest
353     - .fdo.container-build@alpine
354     - .pull_upstream_or_rebuild
355   stage: prep
356   variables:
357     GIT_STRATEGY: none
358     FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkgconfig python3 check-dev valgrind binutils doxygen xz linux-headers'
359
360
361 #################################################################
362 #                                                               #
363 #                   container clean stage                       #
364 #                 run during the clean stage                    #
365 #                                                               #
366 #################################################################
367
368 #
369 # This stage will look for the container images we currently have in
370 # the registry and will remove any that are not tagged with the provided
371 # $container_image:$tag
372 .container-clean:
373   stage: container_clean
374   image: golang:alpine
375   before_script:
376     - apk add python3
377     - pip3 install --user python-gitlab
378   script:
379     - LATEST_TAG=$(echo $DISTRO_CONTAINER_IMAGE | cut -f2 -d:)
380     # Go to your Profile, Settings, Access Tokens
381     # Create a personal token with 'api' scope, copy the value.
382     # Go to Settings, CI/CD, Variables
383     # Define a variable of type File named AUTHFILE. Content is that token
384     # value.
385     - python3 .gitlab-ci/gitlab-container-delete $CI_SERVER_URL $CI_PROJECT_PATH
386             --repository $FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION
387             --authfile $AUTHFILE --exclude-tag "$LATEST_TAG"
388   dependencies: []
389   allow_failure: true
390   only:
391     - schedules
392
393 ### fedora 30
394 fedora:30@container-clean:
395   extends:
396     - .fedora:30
397     - .container-clean
398   needs: ["fedora:30@container-prep"]
399
400 ### fedora 31
401 fedora:31@container-clean:
402   extends:
403     - .fedora:31
404     - .container-clean
405   needs: ["fedora:31@container-prep"]
406
407 ### ubuntu 19.10
408 ubuntu:19.10@container-clean:
409   extends:
410     - .ubuntu:19.10
411     - .container-clean
412   needs: ["ubuntu:19.10@container-prep"]
413
414 ### ubuntu 19.04
415 ubuntu:19.04@container-clean:
416   extends:
417     - .ubuntu:19.04
418     - .container-clean
419   needs: ["ubuntu:19.04@container-prep"]
420
421 ### debian stable
422 debian:stable@container-clean:
423   extends:
424     - .debian:stable
425     - .container-clean
426   needs: ["debian:stable@container-prep"]
427
428 ### debian sid
429 debian:sid@container-clean:
430   extends:
431     - .debian:sid
432     - .container-clean
433   needs: ["debian:sid@container-prep"]
434
435 ### centos 7
436 centos:7@container-clean:
437   extends:
438     - .centos:7
439     - .container-clean
440   needs: ["centos:7@container-prep"]
441
442 ### centos 8
443 centos:8@container-clean:
444   extends:
445     - .centos:8
446     - .container-clean
447   needs: ["centos:8@container-prep"]
448
449 ### arch rolling
450 arch:rolling@container-clean:
451   extends:
452     - .arch:rolling
453     - .container-clean
454   needs: ["arch:rolling@container-prep"]
455
456 ### alpine latest
457 alpine:latest@container-clean:
458   extends:
459     - .alpine:latest
460     - .container-clean
461   needs: ["alpine:latest@container-prep"]
462
463
464 #################################################################
465 #                                                               #
466 #                       build stage                             #
467 #                                                               #
468 #################################################################
469
470 .autotools-build@template:
471   extends:
472     - .autotools_build
473   stage: build
474   dependencies: []
475   variables:
476     MAKE_ARGS: "distcheck"
477
478 .meson-build@template:
479   extends:
480     - .meson_build
481   stage: build
482   dependencies: []
483   variables:
484     NINJA_ARGS: "dist"
485
486
487 fedora:30@autotools-build:
488   extends:
489     - .fedora:30
490     - .autotools-build@template
491   stage: autotools
492   needs: ['fedora:30@container-prep']
493
494 fedora:30@meson-build:
495   extends:
496     - .fedora:30
497     - .meson-build@template
498   stage: meson
499   needs: ['fedora:30@container-prep']
500
501
502 fedora:31@autotools-build:
503   extends:
504     - .fedora:31
505     - .autotools-build@template
506   stage: autotools
507   needs: ['fedora:31@container-prep']
508
509 fedora:31@meson-build:
510   extends:
511     - .fedora:31
512     - .meson-build@template
513   stage: meson
514   needs: ['fedora:31@container-prep']
515
516
517 ubuntu:19.10@autotools-build:
518   extends:
519     - .ubuntu:19.10
520     - .autotools-build@template
521   stage: autotools
522   needs: ['ubuntu:19.10@container-prep']
523
524 ubuntu:19.10@meson-build:
525   extends:
526     - .ubuntu:19.10
527     - .meson-build@template
528   stage: meson
529   needs: ['ubuntu:19.10@container-prep']
530
531
532 ubuntu:19.04@autotools-build:
533   extends:
534     - .ubuntu:19.04
535     - .autotools-build@template
536   stage: autotools
537   needs: ['ubuntu:19.04@container-prep']
538
539 ubuntu:19.04@meson-build:
540   extends:
541     - .ubuntu:19.04
542     - .meson-build@template
543   stage: meson
544   needs: ['ubuntu:19.04@container-prep']
545
546
547 debian:stable@autotools-build:
548   extends:
549     - .debian:stable
550     - .autotools-build@template
551   stage: autotools
552   needs: ['debian:stable@container-prep']
553
554 debian:stable@meson-build:
555   extends:
556     - .debian:stable
557     - .meson-build@template
558   stage: meson
559   needs: ['debian:stable@container-prep']
560
561
562 debian:sid@autotools-build:
563   extends:
564     - .debian:sid
565     - .autotools-build@template
566   stage: autotools
567   needs: ['debian:sid@container-prep']
568
569 debian:sid@meson-build:
570   extends:
571     - .debian:sid
572     - .meson-build@template
573   stage: meson
574   needs: ['debian:sid@container-prep']
575
576
577 centos:7@autotools-build:
578   extends:
579     - .centos:7
580     - .autotools-build@template
581   stage: autotools
582   variables:
583     MAKE_ARGS: ''  # disable distcheck, requires doxygen
584   needs: ['centos:7@container-prep']
585
586
587
588 centos:8@autotools-build:
589   extends:
590     - .centos:8
591     - .autotools-build@template
592   stage: autotools
593   variables:
594     MAKE_ARGS: ''  # disable distcheck, requires doxygen
595   needs: ['centos:8@container-prep']
596
597
598
599 arch:rolling@autotools-build:
600   extends:
601     - .arch:rolling
602     - .autotools-build@template
603   stage: autotools
604   needs: ['arch:rolling@container-prep']
605
606 arch:rolling@meson-build:
607   extends:
608     - .arch:rolling
609     - .meson-build@template
610   stage: meson
611   needs: ['arch:rolling@container-prep']
612
613
614 alpine:latest@autotools-build:
615   extends:
616     - .alpine:latest
617     - .autotools-build@template
618   stage: autotools
619   needs: ['alpine:latest@container-prep']
620
621 alpine:latest@meson-build:
622   extends:
623     - .alpine:latest
624     - .meson-build@template
625   stage: meson
626   needs: ['alpine:latest@container-prep']
627
628
629 # Build argument tests
630 #
631 # We only run the build option combinations on one image
632 # because they're supposed to fail equally on all
633 .fedora-custom-build@autotools-template:
634   extends:
635     - .fedora:31
636     - .autotools-build@template
637   stage: build
638   needs: ['fedora:31@container-prep']
639
640 no-valgrind:autotools:
641   extends: .fedora-custom-build@autotools-template
642   before_script:
643     - dnf remove -y valgrind
644
645 no-check:autotools:
646   extends: .fedora-custom-build@autotools-template
647   before_script:
648     - dnf remove -y check check-devel
649
650 no-doxygen:autotools:
651   extends: .fedora-custom-build@autotools-template
652   before_script:
653     - dnf remove -y doxygen
654   variables:
655     MAKE_ARGS: ''  # disable distcheck, requires doxygen
656
657 # doxygen is required for distcheck
658 no-doxygen-check-valgrind:autotools:
659   extends: .fedora-custom-build@autotools-template
660   before_script:
661     - dnf remove -y doxygen valgrind check check-devel
662   variables:
663     MAKE_ARGS: ''  # disable distcheck, requires doxygen
664
665 no-nm:autotools:
666   extends: .fedora-custom-build@autotools-template
667   before_script:
668     - mv /usr/bin/nm /usr/bin/nm.moved
669
670 enable-gcov:autotools:
671   extends: .fedora-custom-build@autotools-template
672   variables:
673     CONFIGURE_FLAGS: "--enable-gcov"
674
675 .fedora-custom-build@meson-template:
676   extends:
677     - .fedora:31
678     - .meson-build@template
679   stage: build
680   needs: ['fedora:31@container-prep']
681
682 no-valgrind:meson:
683   extends: .fedora-custom-build@meson-template
684   before_script:
685     - dnf remove -y valgrind
686
687 no-check:meson:
688   extends: .fedora-custom-build@meson-template
689   before_script:
690     - dnf remove -y check check-devel
691   variables:
692     MESON_ARGS: -Dtests=disabled
693     SKIP_MESON_TEST: 1
694
695 # doxygen is required for dist
696 no-doxygen:meson:
697   extends: .fedora-custom-build@meson-template
698   before_script:
699     - dnf remove -y doxygen
700   variables:
701     MESON_ARGS: -Ddocumentation=disabled
702     NINJA_ARGS: ''
703
704 # doxygen is required for dist
705 no-doxygen-check-valgrind:meson:
706   extends: .fedora-custom-build@meson-template
707   before_script:
708     - dnf remove -y doxygen valgrind check check-devel
709   variables:
710     MESON_ARGS: -Dtests=disabled -Ddocumentation=disabled
711     NINJA_ARGS: ''
712     SKIP_MESON_TEST: 1
713
714 enable-gcov:meson:
715   extends: .fedora-custom-build@meson-template
716   variables:
717     MESON_ARGS: '-Dcoverity=true'
718
719 scan-build:meson:
720   extends: .fedora-custom-build@meson-template
721   variables:
722     NINJA_ARGS: 'scan-build'
723     SKIP_MESON_TEST: 1
724
725 static-build:meson:
726   extends: .fedora-custom-build@meson-template
727   script:
728     - meson "$MESON_BUILDDIR" --default-library=static --prefix=$PWD/prefix-meson/
729     - ninja -C "$MESON_BUILDDIR" install
730     - ls -l $PWD/prefix-meson/lib64/libevdev.a
731
732 soname:
733   extends:
734     - .fedora:31
735   stage: build
736   script:
737   - ./autogen.sh --prefix=$PWD/prefix-autotools/
738   - make install
739   - ls -l $PWD/prefix-autotools/lib/libevdev.so.2.3.0
740   - meson "$MESON_BUILDDIR" --prefix=$PWD/prefix-meson/
741   - ninja -C "$MESON_BUILDDIR" install
742   - ls -l $PWD/prefix-meson/lib64/libevdev.so.2.3.0
743   needs: ['fedora:31@container-prep']
744
745 #################################################################
746 #                                                               #
747 #                          VM stage                             #
748 #                                                               #
749 #################################################################
750
751 .check_tainted: &check_tainted |
752   # make sure the kernel is not tainted
753   if [[ "$(ssh localhost -p 5555 cat /proc/sys/kernel/tainted)" -gt 0 ]];
754   then
755     echo tainted kernel ;
756     exit 1 ;
757   fi
758
759 .qemu@fedora:31:
760   extends:
761     - .fedora:31
762   stage: VM
763   image: $CI_REGISTRY_IMAGE/$FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION:qemu-$FDO_DISTRIBUTION_TAG
764   tags:
765     - kvm
766   variables:
767     MESON_BUILDDIR: build_dir
768   script:
769     # start our vm, no args required
770     - /app/start_vm.sh
771
772     - *check_tainted
773
774     - "scp -P 5555 -r $PWD localhost:"
775     - echo "CI_JOB_ID=\"$CI_JOB_ID\"" > sshenv
776     - echo "CI_JOB_NAME=\"$CI_JOB_NAME\"" >> sshenv
777     - echo "MESON_BUILDDIR=\"$MESON_BUILDDIR\"" >> sshenv
778     - echo "MESON_TEST_ARGS=\"$MESON_TEST_ARGS\"" >> sshenv
779     - echo "NINJA_ARGS=\"$NINJA_ARGS\"" >> sshenv
780     - "scp -P 5555 sshenv localhost:~/$CI_PROJECT_NAME/.meson_environment"
781     - ssh localhost -p 5555 "cd $CI_PROJECT_NAME ; .gitlab-ci/meson-build.sh" && touch .success || true
782     # no matter the results of the tests, we want to fetch the logs
783     - scp -P 5555 -r localhost:$CI_PROJECT_NAME/"$MESON_BUILDDIR" .
784
785     - *check_tainted
786
787     - ssh localhost -p 5555 halt || true
788     - sleep 2
789     - pkill qemu || true
790
791     - if [[ ! -e .success ]] ;
792       then
793         exit 1 ;
794       fi
795   artifacts:
796     name: "qemu-meson-logs-$CI_JOB_NAME"
797     when: always
798     expire_in: 1 week
799     paths:
800       - $MESON_BUILDDIR/meson-logs
801       - console.out
802     reports:
803       junit: $MESON_BUILDDIR/junit-*.xml
804
805   retry:
806     max: 2
807     when: script_failure
808   needs: ['fedora:31@qemu-prep']
809
810 qemu:meson:
811   extends: .qemu@fedora:31
812
813 qemu:meson:valgrind:
814   extends: .qemu@fedora:31
815   variables:
816     MESON_TEST_ARGS: '--setup=valgrind'
817
818 meson-from-tarball:
819   extends:
820     - .fedora:31
821   stage: tarballs
822   script:
823     - export INSTALLDIR="$PWD/_inst"
824     - mkdir _build
825     - pushd _build > /dev/null
826     - ../autogen.sh --disable-silent-rules $CONFIGURE_FLAGS
827     - make
828     - make distcheck
829     - popd > /dev/null
830     - mkdir -p _tarball_dir
831     - tar xf _build/libevdev-*.tar.xz -C _tarball_dir
832     - pushd _tarball_dir/libevdev-*/ > /dev/null
833     - meson "$MESON_BUILDDIR" --prefix="$INSTALLDIR"
834     - ninja -C "$MESON_BUILDDIR" test
835     - ninja -C "$MESON_BUILDDIR" install
836     - popd > /dev/null
837     - ls -lR $INSTALLDIR
838   needs: ['fedora:31@container-prep']
839
840 autotools-from-tarball:
841   extends:
842     - .fedora:31
843   stage: tarballs
844   script:
845     - export INSTALLDIR="$PWD/_inst"
846     - meson "$MESON_BUILDDIR"
847     - ninja -C "$MESON_BUILDDIR" dist
848     - mkdir -p _tarball_dir
849     - tar xf "$MESON_BUILDDIR"/meson-dist/libevdev-*.xz -C _tarball_dir
850     - pushd _tarball_dir/libevdev-*/ > /dev/null
851     - mkdir _build
852     - pushd _build > /dev/null
853     - ../autogen.sh --disable-silent-rules --prefix="$INSTALLDIR" $CONFIGURE_FLAGS
854     - make
855     - make install
856     - make distcheck
857     - popd > /dev/null
858     - popd > /dev/null
859     - ls -lR $INSTALLDIR
860   needs: ['fedora:31@container-prep']