Eric Engestrom | 329f5cd | 2019-01-20 11:21:45 +0000 | [diff] [blame] | 1 | # This is the tag of the docker image used for the build jobs. If the |
| 2 | # image doesn't exist yet, the containers-build 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 | # |
| 16 | # The format of the tag is "%Y-%m-%d-${counter}" where ${counter} stays |
| 17 | # at "01" unless you have multiple updates on the same day :) |
| 18 | variables: |
| 19 | UBUNTU_TAG: 2019-01-31-01 |
| 20 | UBUNTU_IMAGE: "$CI_REGISTRY/$CI_PROJECT_PATH/ubuntu:$UBUNTU_TAG" |
| 21 | |
| 22 | |
| 23 | stages: |
| 24 | - containers-build |
Eric Engestrom | 46d23c0 | 2019-01-20 11:26:53 +0000 | [diff] [blame] | 25 | - build+test |
Eric Engestrom | 329f5cd | 2019-01-20 11:21:45 +0000 | [diff] [blame] | 26 | |
| 27 | |
| 28 | # CONTAINERS |
| 29 | |
| 30 | containers:ubuntu: |
| 31 | stage: containers-build |
| 32 | image: docker:stable |
| 33 | services: |
| 34 | - docker:dind |
| 35 | variables: |
| 36 | DOCKER_HOST: tcp://docker:2375 |
| 37 | DOCKER_DRIVER: overlay2 |
| 38 | script: |
| 39 | # Enable experimental features such as `docker manifest inspect` |
| 40 | - mkdir -p ~/.docker |
| 41 | - "echo '{\"experimental\": \"enabled\"}' > ~/.docker/config.json" |
| 42 | - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY |
| 43 | # Check if the image (with the specific tag) already exists |
| 44 | - docker manifest inspect $UBUNTU_IMAGE && exit || true |
| 45 | - docker build -t $UBUNTU_IMAGE -f .gitlab-ci/Dockerfile.ubuntu . |
| 46 | - docker push $UBUNTU_IMAGE |
| 47 | only: |
| 48 | changes: |
| 49 | - .gitlab-ci.yml |
| 50 | - .gitlab-ci/Dockerfile.ubuntu |
Eric Engestrom | 46d23c0 | 2019-01-20 11:26:53 +0000 | [diff] [blame] | 51 | |
| 52 | |
| 53 | # BUILD |
| 54 | |
| 55 | .build: |
| 56 | image: $UBUNTU_IMAGE |
| 57 | stage: build+test |
| 58 | artifacts: |
| 59 | when: on_failure |
| 60 | untracked: true |
| 61 | |
| 62 | .meson-build: |
| 63 | extends: .build |
| 64 | before_script: |
| 65 | # We need to control the version of llvm-config we're using, so we'll |
| 66 | # generate a native file to do so. This requires meson >=0.49 |
| 67 | - if test -n "$LLVM_VERSION"; then |
| 68 | LLVM_CONFIG="llvm-config-${LLVM_VERSION}"; |
| 69 | echo -e "[binaries]\nllvm-config = '`which $LLVM_CONFIG`'" > native.file; |
| 70 | $LLVM_CONFIG --version; |
| 71 | else |
| 72 | touch native.file; |
| 73 | fi |
| 74 | - meson --version |
| 75 | - meson _build |
| 76 | --native-file=native.file |
| 77 | -D build-tests=true |
| 78 | -D libunwind=${UNWIND} |
| 79 | ${DRI_LOADERS} |
| 80 | -D dri-drivers=${DRI_DRIVERS:-[]} |
| 81 | ${GALLIUM_ST} |
| 82 | -D gallium-drivers=${GALLIUM_DRIVERS:-[]} |
| 83 | -D vulkan-drivers=${VULKAN_DRIVERS:-[]} |
| 84 | - cd _build |
| 85 | - meson configure |
| 86 | script: |
| 87 | - ninja |
| 88 | - ninja test |
| 89 | |
Eric Engestrom | 89a7467 | 2019-01-21 09:42:37 +0000 | [diff] [blame^] | 90 | .make-build: |
| 91 | extends: .build |
| 92 | variables: |
| 93 | MAKEFLAGS: "-j4" |
| 94 | before_script: |
| 95 | - if test -n "$LLVM_VERSION"; then |
| 96 | export LLVM_CONFIG="llvm-config-${LLVM_VERSION}"; |
| 97 | fi |
| 98 | - mkdir build |
| 99 | - cd build |
| 100 | - ../autogen.sh |
| 101 | --enable-autotools |
| 102 | --enable-debug |
| 103 | $LIBUNWIND_FLAGS |
| 104 | $DRI_LOADERS |
| 105 | --with-dri-drivers=$DRI_DRIVERS |
| 106 | $GALLIUM_ST |
| 107 | --with-gallium-drivers=$GALLIUM_DRIVERS |
| 108 | --with-vulkan-drivers=$VULKAN_DRIVERS |
| 109 | --disable-llvm-shared-libs |
| 110 | script: |
| 111 | - make |
| 112 | - eval $MAKE_CHECK_COMMAND |
| 113 | |
Eric Engestrom | 46d23c0 | 2019-01-20 11:26:53 +0000 | [diff] [blame] | 114 | build:meson-vulkan: |
| 115 | extends: .meson-build |
| 116 | variables: |
| 117 | UNWIND: "false" |
| 118 | DRI_LOADERS: > |
| 119 | -D glx=disabled |
| 120 | -D gbm=false |
| 121 | -D egl=false |
| 122 | -D platforms=x11,wayland,drm |
| 123 | -D osmesa=none |
| 124 | GALLIUM_ST: > |
| 125 | -D dri3=true |
| 126 | -D gallium-vdpau=false |
| 127 | -D gallium-xvmc=false |
| 128 | -D gallium-omx=disabled |
| 129 | -D gallium-va=false |
| 130 | -D gallium-xa=false |
| 131 | -D gallium-nine=false |
| 132 | -D gallium-opencl=disabled |
| 133 | VULKAN_DRIVERS: intel,amd |
| 134 | LLVM_VERSION: "7" |
Eric Engestrom | 89a7467 | 2019-01-21 09:42:37 +0000 | [diff] [blame^] | 135 | |
| 136 | build:make-vulkan: |
| 137 | extends: .make-build |
| 138 | variables: |
| 139 | MAKE_CHECK_COMMAND: "make -C src/gtest check && make -C src/intel check" |
| 140 | LLVM_VERSION: "7" |
| 141 | DRI_LOADERS: > |
| 142 | --disable-glx |
| 143 | --disable-gbm |
| 144 | --disable-egl |
| 145 | --with-platforms=x11,wayland,drm |
| 146 | DRI_DRIVERS: "" |
| 147 | GALLIUM_ST: > |
| 148 | --enable-dri |
| 149 | --enable-dri3 |
| 150 | --disable-opencl |
| 151 | --disable-xa |
| 152 | --disable-nine |
| 153 | --disable-xvmc |
| 154 | --disable-vdpau |
| 155 | --disable-va |
| 156 | --disable-omx-bellagio |
| 157 | --disable-gallium-osmesa |
| 158 | VULKAN_DRIVERS: intel,radeon |
| 159 | LIBUNWIND_FLAGS: --disable-libunwind |