tests: qemucapabilitiesdata: Update 'x86_64' capabilities for the qemu-9.2 dev cycle
[libvirt.git] / .gitlab-ci.yml
blob6de867e1f20f9b0d9a2d46f5838a4b564cb881b8
1 variables:
2   GIT_DEPTH: 100
4 stages:
5   - containers
6   - builds
7   - integration_tests
8   - sanity_checks
9   - pages
11 .script_variables: &script_variables |
12   export CCACHE_BASEDIR="$(pwd)"
13   export CCACHE_DIR="$CCACHE_BASEDIR/ccache"
14   export CCACHE_MAXSIZE="500M"
15   export PATH="$CCACHE_WRAPPERSDIR:$PATH"
16   export VIR_TEST_VERBOSE="1"
17   export VIR_TEST_DEBUG="1"
19 include:
20   - '/ci/gitlab.yml'
21   - '/ci/integration.yml'
23 .native_build_job:
24   extends: .gitlab_native_build_job
25   cache:
26     paths:
27       - ccache/
28     key: "$CI_JOB_NAME"
29   script:
30     - source ci/jobs.sh
31     - if test -x /usr/bin/rpmbuild && test "$RPM" != "skip";
32       then
33         run_rpmbuild;
34       else
35         run_build;
36         run_test;
37       fi
38   after_script:
39     - test "$CI_JOB_STATUS" != "success" && exit 1;
40     - if test -x /usr/bin/rpmbuild && test "$RPM" != "skip";
41       then
42         mv "$HOME"/rpmbuild/RPMS/x86_64/ libvirt-rpms/;
43       fi
45 .cross_build_job:
46   extends: .gitlab_cross_build_job
47   cache:
48     paths:
49       - ccache/
50     key: "$CI_JOB_NAME"
51   script:
52     - source ci/jobs.sh
53     - if test -x /usr/bin/rpmbuild && test "$RPM" != "skip";
54       then
55         run_rpmbuild;
56       else
57         run_build;
58         if test "$CROSS" = "i686";
59         then
60           run_test;
61         fi;
62       fi
64 # This artifact published by this job is downloaded by libvirt.org to
65 # be deployed to the web root:
66 #    https://gitlab.com/libvirt/libvirt/-/jobs/artifacts/master/download?job=website
67 website_job:
68   extends: .gitlab_native_build_job
69   needs:
70     - job: x86_64-almalinux-9-container
71       optional: true
72   script:
73     - source ci/jobs.sh
74     - run_website_build
75   after_script:
76     - test "$CI_JOB_STATUS" != "success" && exit 1;
77     - mv install/usr/share/doc/libvirt/html/ website
78   artifacts:
79     expose_as: 'Website'
80     name: 'website'
81     when: on_success
82     expire_in: 30 days
83     paths:
84       - website
85   variables:
86     NAME: almalinux-9
87     TARGET_BASE_IMAGE: docker.io/library/almalinux:9
89 # On push to master publish the website from 'website_job' via gitlab pages
90 pages:
91   stage: pages
92   script:
93     - mv website public
94     - cp .gitlab_pages_redirects public/_redirects
95   dependencies:
96     - website_job
97   rules:
98     - if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
99       when: always
100     - when: never
101   artifacts:
102     expose_as: 'pages'
103     name: 'pages'
104     paths:
105       - public
107 codestyle_job:
108   stage: sanity_checks
109   extends: .gitlab_native_build_job
110   needs:
111     - job: x86_64-opensuse-leap-15-container
112       optional: true
113   script:
114     - source ci/jobs.sh
115     - run_codestyle
116   variables:
117     NAME: opensuse-leap-15
118     TARGET_BASE_IMAGE: registry.opensuse.org/opensuse/leap:15.5
120 # This artifact published by this job is downloaded to push to Weblate
121 # for translation usage:
122 #    https://gitlab.com/libvirt/libvirt/-/jobs/artifacts/master/download?job=potfile
123 potfile:
124   image: $CI_REGISTRY/$RUN_UPSTREAM_NAMESPACE/libvirt/ci-$NAME:latest
125   stage: builds
126   variables:
127     NAME: almalinux-9
128   before_script:
129     - cat /packages.txt
130   needs:
131     - job: x86_64-almalinux-9-container
132       optional: true
133   rules:
134     - if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
135       when: on_success
136     - when: never
137   before_script:
138     - *script_variables
139   script:
140     - source ci/jobs.sh
141     - run_potfile
142   after_script:
143     - test "$CI_JOB_STATUS" != "success" && exit 1;
144     - cp po/libvirt.pot libvirt.pot
145   artifacts:
146     expose_as: 'Potfile'
147     name: 'potfile'
148     when: on_success
149     expire_in: 30 days
150     paths:
151       - libvirt.pot
153 # Coverity job that is run only by schedules
154 coverity:
155   image: $CI_REGISTRY/$RUN_UPSTREAM_NAMESPACE/libvirt/ci-$NAME:latest
156   stage: builds
157   needs:
158     - job: x86_64-almalinux-9-container
159       optional: true
160   before_script:
161     - cat /packages.txt
162   script:
163     - curl https://scan.coverity.com/download/cxx/linux64 --form project=$COVERITY_SCAN_PROJECT_NAME --form token=$COVERITY_SCAN_TOKEN -o /tmp/cov-analysis-linux64.tgz
164     - tar xfz /tmp/cov-analysis-linux64.tgz
165     - meson setup build --werror || (cat build/meson-logs/meson-log.txt && exit 1)
166     - cov-analysis-linux64-*/bin/cov-build --dir cov-int meson compile -C build
167     - tar cfz cov-int.tar.gz cov-int
168     - curl https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME --form token=$COVERITY_SCAN_TOKEN --form email=$GITLAB_USER_EMAIL --form file=@cov-int.tar.gz --form version="$(git describe --tags)" --form description="$(git describe --tags) / $CI_COMMIT_TITLE / $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID"
169   variables:
170     NAME: almalinux-9
171   rules:
172     - if: '$COVERITY_SCAN_PROJECT_NAME == null || $COVERITY_SCAN_TOKEN == null'
173       when: never
174     - if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
175       when: on_success
176     - when: never