Debian Codegraph @

.gitlab-ci.yml

raw symbols SCIP
1 stages:
2 - containers
3 - builds
4 - sanity_checks
5
6 .multilib: &multilib |
7 dpkg_architecture=$(which dpkg-architecture 2>/dev/null || true)
8 rpm=$(which rpm 2>/dev/null || true)
9 if test -x "$dpkg_architecture"; then
10 multilib=$(dpkg-architecture -q DEB_TARGET_MULTIARCH);
11 elif test -x "$rpm"; then
12 multilib=$(rpm --eval '%{_lib}');
13 fi
14
15 .native-environment: &native-environment |
16 export VIRT_PREFIX="$HOME/build/libvirt"
17 export PATH="$VIRT_PREFIX/bin:$PATH"
18 export C_INCLUDE_PATH="$VIRT_PREFIX/include"
19 export LD_LIBRARY_PATH="$VIRT_PREFIX/$multilib"
20 export PKG_CONFIG_PATH="$VIRT_PREFIX/$multilib/pkgconfig"
21 export XDG_DATA_DIRS="$VIRT_PREFIX/share:/usr/share:/usr/local/share"
22 export GI_TYPELIB_PATH="$VIRT_PREFIX/$multilib/girepository-1.0"
23 export OSINFO_SYSTEM_DIR="$VIRT_PREFIX/share/osinfo"
24 export MAKEFLAGS="-j $(getconf _NPROCESSORS_ONLN)"
25 export CCACHE_BASEDIR="$(pwd)"
26 export CCACHE_DIR="$CCACHE_BASEDIR/ccache"
27 export CCACHE_MAXSIZE="50M"
28 export PATH="$CCACHE_WRAPPERSDIR:$PATH"
29
30
31 .native_build_job:
32 extends:
33 - .gitlab_native_build_job
34 cache:
35 paths:
36 - ccache
37 key: "$CI_JOB_NAME"
38 script:
39 - *multilib
40 - *native-environment
41 - HERE=$PWD
42 - cd /tmp
43 - git clone https://gitlab.com/libosinfo/osinfo-db-tools.git
44 - cd osinfo-db-tools
45 - mkdir build
46 - cd build
47 - meson .. . --prefix=$VIRT_PREFIX
48 - $NINJA install
49 - cd $HERE
50 - mkdir build
51 - cd build
52 - $MAKE -f ../Makefile VPATH=..
53 - $MAKE -f ../Makefile VPATH=.. install OSINFO_DB_TARGET="--system"
54 - $MAKE -f ../Makefile VPATH=.. check
55 - if test -x /usr/bin/rpmbuild && test "$RPM" != "skip";
56 then
57 rpmbuild --nodeps --define "_without_mingw 1" --define "_sourcedir $PWD" -ba osinfo-db.spec;
58 fi
59
60 urlcheck:
61 image: python:latest
62 stage: sanity_checks
63 needs: []
64 before_script:
65 - apt-get update
66 - apt-get -y install gettext
67 - pip install pytest-xdist lxml requests
68 script:
69 - make -j$(nproc) data
70 # Overcommit 'nproc' because much of the time we'll
71 # be waiting on network I/O, and not CPU bound
72 - pytest -v -n $(expr $(nproc) '*' 4) tests/test_urls.py
73 rules:
74 - if: '$OSINFO_CI_CHECK_URLS'
75 when: on_success
76 - when: never
77
78
79 # Going against our usual naming convention for jobs using prebuilt containers
80 # here as we'll be consuming the job artifacts via a direct URL which includes
81 # the GitLab job name, so let's go with a more convenient name
82 publish:
83 extends:
84 - .gitlab_native_build_job
85 needs:
86 - job: x86_64-debian-12-container
87 optional: true
88 script:
89 - apt update && apt install -y osinfo-db-tools
90 - make V=1 ARCHIVE=osinfo-db-latest.tar.xz
91 artifacts:
92 expire_in: 1 day
93 paths:
94 - osinfo-db-latest.tar.xz
95 variables:
96 TARGET_BASE_IMAGE: docker.io/library/debian:12-slim
97 NAME: debian-12
98
99 .web:
100 image: docker.io/library/python:3.9-alpine
101 stage: builds
102 before_script:
103 - apk add git gpg gpg-agent
104 script:
105 - ./scripts/osinfo-db-web.py
106 artifacts:
107 paths:
108 - public/
109
110 # This job creates artifacts which can be browsed without making live
111 web:
112 extends: .web
113 rules:
114 # Only run if it is a merge request, or a forced pipeline
115 - if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $RUN_PIPELINE == "1"'
116 when: on_success
117 - when: never
118
119 # This job creates artifacts and publishes them to the live site
120 pages:
121 extends: .web
122 rules:
123 # We can publish the website from pushes to the main branch only
124 - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
125 when: on_success
126 - when: never
127
128 include: '/ci/gitlab.yml'