OSDN Git Service

gitlab-ci: pre-build containers to improve CI run time and reliability
[android-x86/external-libdrm.git] / .gitlab-ci.yml
1 # This is the tag of the docker image used for the build jobs. If the
2 # image doesn't exist yet, the containers stage generates it.
3 #
4 # In order to generate a new image, one should generally change the tag.
5 # While removing the image from the registry would also work, that's not
6 # recommended except for ephemeral images during development: Replacing
7 # an image after a significant amount of time might pull in newer
8 # versions of gcc/clang or other packages, which might break the build
9 # with older commits using the same tag.
10 #
11 # After merging a change resulting in generating a new image to the
12 # main repository, it's recommended to remove the image from the source
13 # repository's container registry, so that the image from the main
14 # repository's registry will be used there as well.
15 variables:
16   UPSTREAM_REPO: mesa/drm
17   DEBIAN_TAG: "2019-10-20"
18   DEBIAN_VERSION: buster-slim
19   DEBIAN_IMAGE: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_TAG"
20   ARCH_TAG: "2019-10-20"
21   ARCH_VERSION: rolling
22   ARCH_IMAGE: "$CI_REGISTRY_IMAGE/archlinux/$ARCH_VERSION:$ARCH_TAG"
23
24 include:
25   - project: 'wayland/ci-templates'
26     ref: 1f7f57c64ff4ebbf7292e3b7a13600518b8cb24c
27     file: '/templates/debian.yml'
28   - project: 'wayland/ci-templates'
29     ref: 1f7f57c64ff4ebbf7292e3b7a13600518b8cb24c
30     file: '/templates/arch.yml'
31
32 stages:
33   - containers
34   - build
35
36
37 # When & how to run the CI
38 .ci-run-policy:
39   retry:
40     max: 2
41     when:
42       - runner_system_failure
43
44 # CONTAINERS
45
46 debian:
47   stage: containers
48   extends:
49     - .ci-run-policy
50     - .debian@container-ifnot-exists
51   variables:
52     GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image
53     DEBIAN_EXEC: 'bash .gitlab-ci/debian-install.sh'
54
55 arch:
56   stage: containers
57   extends:
58     - .ci-run-policy
59     - .arch@container-ifnot-exists
60   variables:
61     GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image
62     ARCH_EXEC: 'bash .gitlab-ci/arch-install.sh'
63
64
65 # BUILD
66
67 .meson-build:
68   stage: build
69   extends: .ci-run-policy
70   variables:
71     GIT_DEPTH: 10
72   script:
73     - meson _build
74         -D amdgpu=true
75         -D cairo-tests=true
76         -D etnaviv=true
77         -D exynos=true
78         -D freedreno=true
79         -D freedreno-kgsl=true
80         -D intel=true
81         -D libkms=true
82         -D man-pages=true
83         -D nouveau=true
84         -D omap=true
85         -D radeon=true
86         -D tegra=true
87         -D udev=true
88         -D valgrind=true
89         -D vc4=true
90         -D vmwgfx=true
91     - ninja -C _build
92     - ninja -C _build test
93     - DESTDIR=$PWD/install ninja -C _build install
94   artifacts:
95     when: on_failure
96     paths:
97       - _build/meson-logs/*
98
99 meson-debian:
100   extends: .meson-build
101   image: $DEBIAN_IMAGE
102   needs:
103     - debian
104
105 meson-arch:
106   extends: .meson-build
107   image: $ARCH_IMAGE
108   needs:
109     - arch