.gitlab-ci.yml 4.05 KB
Newer Older
1
# The container images used in this pipeline are built from this
2
3
4
5
6
# GitLab project: https://gitlab.gnome.org/GNOME/tracker-oci-images

variables:
  # These can be used to see verbose log output from the functional-tests.
  # See HACKING.md for more information.
7
  G_MESSAGES_DEBUG: ""
8
  TRACKER_DEBUG: ""
9
10
11

  # This can be used when debugging test failures that only occur within GitLab CI.
  MESON_TEST_EXTRA_ARGS: ""
12

13
  TRACKER_TESTS_AWAIT_TIMEOUT: 60
14

Sam Thursfield's avatar
Sam Thursfield committed
15
16
stages:
  - test
17
  - analysis
18
19

.test_template: &test
Sam Thursfield's avatar
Sam Thursfield committed
20
21
22
23
24
  stage: test

  script:
    # We can build and test tracker-miners against tracker just by building
    # tracker as a submodule.
25
    - .gitlab-ci/checkout-tracker.sh
26
    - echo "Building tracker.git commit $(git -C ./subprojects/tracker rev-parse HEAD)"
27
28
    - mkdir build
    - cd build
29
    - meson .. --prefix=/usr -Dtracker_core=subproject -Db_lto=true -Db_coverage=true -Dtests_tap_protocol=true
30
    - ninja
31
32
33
34
35
36
    - |
      # Remove the many "CI_" variables from the environment. Meson dumps the
      # whole environment for every failed test, and that gives a whole
      # screenful of junk each time unless we strip these.
      unset $(env|grep -o '^CI_[^=]*')

37
      dbus-run-session -- env LANG=C.UTF-8 LC_ALL=C.UTF-8 eatmydata meson test --suite tracker-miners --print-errorlogs
38
39
40
41
42
43
44
45
46

  after_script:
    - |
      echo "Distribution: "
      echo
      egrep '^NAME=|^VERSION=' /etc/os-release
      echo
      echo "Test suite settings:"
      echo
47
48
      echo "G_MESSAGES_DEBUG: ${G_MESSAGES_DEBUG}"
      echo "TRACKER_DEBUG: ${TRACKER_DEBUG}"
49
50
51
      echo "MESON_TEST_EXTRA_ARGS: ${MESON_TEST_EXTRA_ARGS}"
      echo
      echo "These values can be set at https://gitlab.gnome.org/GNOME/tracker/pipelines/new"
52
53
54
55

  artifacts:
    when: always
    paths:
Marco Trevisan's avatar
Marco Trevisan committed
56
    - build/meson-logs/*.txt
57
58
    reports:
      junit: "build/meson-logs/testlog.junit.xml"
59
60
61
62
63

test-fedora-latest:
  image: registry.gitlab.gnome.org/gnome/tracker-oci-images/amd64/fedora:latest
  <<: *test

Sam Thursfield's avatar
Sam Thursfield committed
64
65
66
67
test-fedora-rawhide:
  image: registry.gitlab.gnome.org/gnome/tracker-oci-images/amd64/fedora:rawhide
  <<: *test

68
69
70
test-ubuntu-rolling:
  image: registry.gitlab.gnome.org/gnome/tracker-oci-images/amd64/ubuntu:rolling
  <<: *test
71

Carlos Garnacho's avatar
Carlos Garnacho committed
72
73
74
75
76
coverage-analysis:
  stage: analysis
  image: registry.gitlab.gnome.org/gnome/tracker-oci-images/amd64/fedora:latest
  allow_failure: true
  script:
77
78
79
80
81
82
83
    - .gitlab-ci/checkout-tracker.sh
    - mkdir -p coverage-build/coveragereport
    - cd coverage-build
    - meson .. --prefix=/usr -Dtracker_core=subproject -Db_lto=true -Db_coverage=true -Dseccomp=false
    - ninja
    - env LANG=C.UTF-8 LC_ALL=C.UTF-8 dbus-run-session eatmydata meson test --print-errorlogs ${MESON_TEST_EXTRA_ARGS}
    - gcovr --html-details --print-summary --root=.. --exclude=subprojects --exclude=../subprojects --exclude=../tests --output coveragereport/index.html
Carlos Garnacho's avatar
Carlos Garnacho committed
84
85
86
87
88
89
  coverage: '/^lines: (\d+\.\d+\%)/'
  artifacts:
    when: always
    paths:
    - coverage-build/coveragereport

90
91
92
93
94
95
96
coverity:
  stage: analysis
  image: registry.gitlab.gnome.org/gnome/tracker-oci-images/amd64/fedora:latest
  allow_failure: true
  script:
    # Build tracker, we must go out the subproject route as we don't want
    # tracker code to be included in the coverity reports for tracker-miners.
97
98
    - .gitlab-ci/checkout-tracker.sh
    - export INSTALL=`pwd`/install
Carlos Garnacho's avatar
Carlos Garnacho committed
99
    - pushd subprojects/tracker; meson build --libdir lib --prefix $INSTALL; pushd build; ninja install; popd; popd
100
101
102
103
104
105
106
107
108
109
    - curl https://scan.coverity.com/download/linux64 --data "token=$COVERITY_TOKEN&project=tracker-miners" --output /tmp/coverity_tool.tgz
    - tar zxf /tmp/coverity_tool.tgz
    - mkdir coverity-build
    - export CC=clang
    - pushd coverity-build
    - meson --pkg-config-path=$INSTALL/lib/pkgconfig ..
    - ../cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja
    - tar czf cov-int.tar.gz cov-int
    - popd
    - curl https://scan.coverity.com/builds?project=tracker-miners
110
111
      --form token=$COVERITY_TOKEN --form email=carlosg@gnome.org
      --form file=@coverity-build/cov-int.tar.gz --form version="`git describe --tags`"
112
      --form description="gitlab CI build"
113
114
  only:
    - master