.gitlab-ci.yml 5.47 KB
Newer Older
1
image: $CI_REGISTRY/$CI_PROJECT_PATH/igt-fedora:latest
2 3 4 5 6 7 8 9 10 11
variables:
  MESON_OPTIONS: >
    -Dwith_libdrm=intel,nouveau,amdgpu
    -Dbuild_overlay=true
    -Dbuild_audio=true
    -Dbuild_chamelium=true
    -Dwith_valgrind=true
    -Dbuild_man=true
    -Dbuild_tests=true
    -Dbuild_runner=true
12
    -Dwith_libunwind=true
13
  LANG: "C.UTF-8"
14 15 16 17 18 19 20

stages:
  - containers
  - build
  - test
  - deploy

21 22
#################### BUILD #########################

23 24 25 26 27
build:tests-fedora:
  stage: build
  script:
    - meson $MESON_OPTIONS build
    - ninja -C build
28
    - ninja -C build igt-gpu-tools-doc
29 30 31 32
  artifacts:
    paths:
      - build

33 34 35 36 37 38 39
build:tests-fedora-no-libunwind:
  stage: build
  script:
    - dnf remove -y libunwind-devel
    - meson -Dlibunwind=false build
    - ninja -C build

40 41 42 43 44 45 46 47 48 49
# documentation building is different with meson<0.47
build:tests-fedora-oldest-meson:
  stage: build
  script:
    - dnf remove -y meson
    - pip3 install /usr/src/meson-*.tar.gz
    - meson $MESON_OPTIONS build
    - ninja -C build
    - ninja -C build igt-gpu-tools-doc

50
build:tests-debian-meson:
51
  image: $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian:latest
52 53 54 55
  stage: build
  script:
    - meson $MESON_OPTIONS build
    - ninja -C build
56 57 58 59 60
    - cp build/tests/test-list.txt meson-test-list.txt
  artifacts:
    paths:
      - meson-test-list.txt

Tomi Valkeinen's avatar
Tomi Valkeinen committed
61 62 63 64 65 66 67 68 69 70 71
build:tests-debian-meson-armhf:
  image: $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian-armhf:latest
  stage: build
  script:
    - export PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig/
    - meson --cross-file meson-cross-armhf.txt build
    - ninja -C build
  artifacts:
    paths:
      - build

72 73 74 75
build:tests-debian-meson-arm64:
  image: $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian-arm64:latest
  stage: build
  script:
76 77
    - export PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig/
    - meson --cross-file meson-cross-arm64.txt build
78 79 80 81
    - ninja -C build
  artifacts:
    paths:
      - build
82

83 84 85 86 87 88
build:tests-debian-autotools:
  image: $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian:latest
  stage: build
  script:
    - ./autogen.sh --enable-{chamelium,audio,intel,amdgpu,nouveau,tests,runner}
    - make -j
89 90 91 92
    - cp tests/test-list.txt autotools-test-list.txt
  artifacts:
    paths:
      - autotools-test-list.txt
93

94 95 96 97 98
#################### TEST ##########################

test:ninja-test:
  dependencies:
    - build:tests-fedora
99
  stage: test
100 101
  script: ninja -C build test

102 103 104 105 106
test:ninja-test-arm64:
  image: $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian-arm64:latest
  dependencies:
    - build:tests-debian-meson-arm64
  stage: test
107
  script:
108
    - export PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig/
109 110 111 112 113 114
    - env > build/envdump.txt
    - ninja -C build test
  artifacts:
    paths:
      - build
    when: on_failure
115

116 117 118 119 120 121 122 123 124 125 126 127 128 129
test:ninja-test-armhf:
  image: $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian-armhf:latest
  dependencies:
    - build:tests-debian-meson-armhf
  stage: test
  script:
    - export PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig/
    - env > build/envdump.txt
    - ninja -C build test
  artifacts:
    paths:
      - build
    when: on_failure

130 131 132 133 134
test:test-list-diff:
  dependencies:
    - build:tests-debian-autotools
    - build:tests-debian-meson
  stage: test
135
  script: diff <(sed "s/ /\n/g" meson-test-list.txt| grep -v 'vc4\|v3d' | sort) <(sed "s/ /\n/g" autotools-test-list.txt | sort)
136 137

################### DEPLOY #########################
138 139

pages:
140 141
  dependencies:
    - build:tests-fedora
142 143 144 145 146 147 148 149 150 151
  stage: deploy
  script:
    - ninja -C build igt-gpu-tools-doc
    - cp -r build/docs/reference/igt-gpu-tools/html public
  artifacts:
    paths:
      - public
  only:
    - master

152 153
################# CONTAINERS #######################

154 155 156
containers:igt-debian:
  stage: containers
  image: docker:stable
157 158 159
  only:
    changes:
      - Dockerfile.debian
160
      - .gitlab-ci.yml
161 162 163 164 165 166 167 168 169 170
  services:
    - docker:dind
  variables:
    DOCKER_HOST: tcp://docker:2375
    DOCKER_DRIVER: overlay2
  script:
    - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
    - docker build -t $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian -f Dockerfile.debian .
    - docker push $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian

Tomi Valkeinen's avatar
Tomi Valkeinen committed
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
containers:igt-debian-armhf:
  stage: containers
  image: docker:stable
  only:
    changes:
      - Dockerfile.debian-armhf
      - .gitlab-ci.yml
  services:
    - docker:dind
  variables:
    DOCKER_HOST: tcp://docker:2375
    DOCKER_DRIVER: overlay2
  script:
    - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
    - docker build -t $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian-armhf -f Dockerfile.debian-armhf .
    - docker push $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian-armhf

188 189 190 191 192 193
containers:igt-debian-arm64:
  stage: containers
  image: docker:stable
  only:
    changes:
      - Dockerfile.debian-arm64
194
      - .gitlab-ci.yml
195 196 197 198 199 200 201 202 203 204
  services:
    - docker:dind
  variables:
    DOCKER_HOST: tcp://docker:2375
    DOCKER_DRIVER: overlay2
  script:
    - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
    - docker build -t $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian-arm64 -f Dockerfile.debian-arm64 .
    - docker push $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian-arm64

205 206 207
containers:igt-fedora:
  stage: containers
  image: docker:stable
208 209 210
  only:
    changes:
      - Dockerfile.fedora
211
      - .gitlab-ci.yml
212 213 214 215 216 217 218 219 220
  services:
    - docker:dind
  variables:
    DOCKER_HOST: tcp://docker:2375
    DOCKER_DRIVER: overlay2
  script:
    - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
    - docker build -t $CI_REGISTRY/$CI_PROJECT_PATH/igt-fedora -f Dockerfile.fedora .
    - docker push $CI_REGISTRY/$CI_PROJECT_PATH/igt-fedora