tests: ocaml: Test NBDKit.version () binding
[nbdkit.git] / .gitlab-ci.yml
blobece6ced10e134d91700d14b607776060518b16c1
1 variables:
2   GIT_DEPTH: 100
3   DOCKER_DRIVER: overlay2
5 stages:
6   - containers
7   - builds
8   - sanity_checks
10 .script_variables: &script_variables |
11   export MAKEFLAGS="-j $(getconf _NPROCESSORS_ONLN)"
12   export CCACHE_BASEDIR="$(pwd)"
13   export CCACHE_DIR="$CCACHE_BASEDIR/ccache"
14   export CCACHE_MAXSIZE="500M"
15   export PATH="$CCACHE_WRAPPERSDIR:$PATH"
17 include: '/ci/gitlab.yml'
19 .base_build_job:
20   stage: builds
21   cache:
22     paths:
23       - ccache/
24     key: "$CI_JOB_NAME"
25   script:
26     - *script_variables
27     - ci/build.sh
28   artifacts:
29     paths:
30       - "config.log"
31       - "**/test-suite.log"
32     public: true
33     when: always
34     expire_in: 1 week
36 .native_build_job_prebuilt_env:
37   extends:
38     - .base_build_job
39     - .gitlab_native_build_job_prebuilt_env
41 .native_build_job_local_env:
42   extends:
43     - .base_build_job
44     - .gitlab_native_build_job_local_env
46 .cross_build_job_prebuilt_env:
47   extends:
48     - .base_build_job
49     - .gitlab_cross_build_job_prebuilt_env
51 .cross_build_job_local_env:
52   extends:
53     - .base_build_job
54     - .gitlab_cross_build_job_local_env
56 # Jobs that we delegate to Cirrus CI because they require an operating
57 # system other than Linux. These jobs will only run if the required
58 # setup has been performed on the GitLab account (see ci/README.rst).
60 # The Cirrus CI configuration is generated by replacing target-specific
61 # variables in a generic template: some of these variables are provided
62 # when the GitLab CI job is defined, others are taken from a shell
63 # snippet generated using lcitool.
65 # Note that the $PATH environment variable has to be treated with
66 # special care, because we can't just override it at the GitLab CI job
67 # definition level or we risk breaking it completely.
68 .cirrus_build_job:
69   stage: builds
70   image: registry.gitlab.com/libvirt/libvirt-ci/cirrus-run:master
71   needs: []
72   script:
73     - source ci/cirrus/$NAME.vars
74     - sed -e "s|[@]CI_REPOSITORY_URL@|$CI_REPOSITORY_URL|g"
75           -e "s|[@]CI_COMMIT_REF_NAME@|$CI_COMMIT_REF_NAME|g"
76           -e "s|[@]CI_COMMIT_SHA@|$CI_COMMIT_SHA|g"
77           -e "s|[@]CIRRUS_VM_INSTANCE_TYPE@|$CIRRUS_VM_INSTANCE_TYPE|g"
78           -e "s|[@]CIRRUS_VM_IMAGE_SELECTOR@|$CIRRUS_VM_IMAGE_SELECTOR|g"
79           -e "s|[@]CIRRUS_VM_IMAGE_NAME@|$CIRRUS_VM_IMAGE_NAME|g"
80           -e "s|[@]UPDATE_COMMAND@|$UPDATE_COMMAND|g"
81           -e "s|[@]UPGRADE_COMMAND@|$UPGRADE_COMMAND|g"
82           -e "s|[@]INSTALL_COMMAND@|$INSTALL_COMMAND|g"
83           -e "s|[@]PATH@|$PATH_EXTRA${PATH_EXTRA:+:}\$PATH|g"
84           -e "s|[@]PKG_CONFIG_PATH@|$PKG_CONFIG_PATH|g"
85           -e "s|[@]PKGS@|$PKGS|g"
86           -e "s|[@]MAKE@|$MAKE|g"
87           -e "s|[@]PYTHON@|$PYTHON|g"
88           -e "s|[@]PIP3@|$PIP3|g"
89           -e "s|[@]PYPI_PKGS@|$PYPI_PKGS|g"
90       <ci/cirrus/build.yml >ci/cirrus/$NAME.yml
91     - cat ci/cirrus/$NAME.yml
92     - cirrus-run -v --show-build-log always ci/cirrus/$NAME.yml
93   rules:
94     - if: "$CIRRUS_GITHUB_REPO && $CIRRUS_API_TOKEN"