fontconfig/.gitlab-ci/ci.template

201 lines
6.2 KiB
Plaintext
Raw Normal View History

# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0 filetype=yaml:
{# You're looking at the template here, so you can ignore the below
warning. This is the right file to edit #}
#######################################
# #
# THIS FILE IS GENERATED, DO NOT EDIT #
# #
#######################################
# To change the gitlab CI, edit .gitlab-ci/ci.template and/or .gitlab-ci/config.yml
# and run ci-fairy generate-template. For details, see
# https://freedesktop.pages.freedesktop.org/ci-templates/ci-fairy.html#templating-gitlab-ci-yml
2023-07-15 09:00:23 +02:00
.templates_sha: &template_sha 81a36b5c5349fd3222036bb3caa0166083a3fd44
include:
{% for distro in distributions|sort(attribute="name") %}
# {{ distro.name.capitalize() }} container builder template
- project: 'freedesktop/ci-templates'
ref: *template_sha
file: '/templates/{{distro.name}}.yml'
{% endfor %}
- project: 'freedesktop/ci-templates'
ref: *template_sha
file: '/templates/ci-fairy.yml'
2023-04-06 09:46:54 +02:00
- local: '.gitlab-ci/other.yml'
stages:
- prep
- test
- container_clean
variables:
FDO_UPSTREAM_REPO: fontconfig/fontconfig
GIT_DEPTH: 1
# these tags should be updated each time the list of packages is updated
# changing these will force rebuilding the associated image
# Note: these tags have no meaning and are not tied to a particular
# fontconfig version
{% for distro in distributions %}
{{"%-13s"| format(distro.name.upper() + '_TAG:')}}'{{distro.tag}}-{{
(ci_fairy.hashfiles('.gitlab-ci/config.yml',
'.gitlab-ci/' + distro.name + '-install.sh'))[0:12]
}}'
{% endfor %}
{% for distro in distributions %}
{{"%-13s"| format(distro.name.upper() + '_EXEC:')}}'bash .gitlab-ci/{{distro.name}}-install.sh'
{% endfor %}
#######################################
# #
# containers stage #
# #
#######################################
# Build a container for each distribution + version. The ci-templates
# will re-use the containers if the tag doesn't change.
{% for distro in distributions %}
{% for version in distro.versions %}
{{distro.name}}:{{version}}@container-prep:
2023-04-06 09:46:54 +02:00
extends: .fdo.container-build@{{distro.name}}
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '{{version}}'
FDO_DISTRIBUTION_PACKAGES: '{{' '.join(packages[distro.name].needed)}}'
FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
FDO_DISTRIBUTION_EXEC: ${{distro.name.upper()}}_EXEC
{% endfor %}
{% endfor %}
#######################################
# #
# container clean stage #
# #
#######################################
#
# This stage will look for the container images e currently have in
# the registry and will remove any that are not tagged with the provided
# $container_image:$tag
#
# This job only runs for a scheduled pipeline.
#
# Go to your Profile, Settings, Access Tokens
# Create a personal token with `api' scope, copy the value.
# Go to CI/CD, Schedules, schedule a monthly job.
# Define a variable of type File named AUTHFILE. Content is that token
# value.
.container-clean:
stage: container_clean
image: golang:alpine
before_script:
- apk add python3 py-pip git
- pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
script:
- ci-fairy -v --authfile $AUTHFILE delete-image
--repository $FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION
2023-03-31 16:27:21 +02:00
--exclude-tag $FDO_DISTRIBUTION_TAG
dependencies: []
allow_failure: true
only:
- schedules
{% for distro in distributions %}
{% for version in distro.versions %}
{{distro.name}}:{{version}}@container-clean:
extends:
- .container-clean
variables:
GIT_STRATEGY: none
CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/{{distro.name}}/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
FDO_DISTRIBUTION_VERSION: '{{version}}'
FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
{% endfor %}
{% endfor %}
#######################################
# #
# build stage #
# #
#######################################
2023-04-06 09:46:54 +02:00
.build@template:
before_script:
- pip install meson
script:
- export BUILD_ID="fontconfig-$CI_JOB_NAME_$CI_COMMIT_SHA-$CI_JOB_ID"
- export PREFIX="$(pwd)/prefix-$BUILD_ID"
- export BUILDDIR="$(pwd)/build-$BUILD_ID"
- export MAKEFLAGS="-j4"
2023-04-06 09:46:54 +02:00
- |
buildopt=()
for bo in $FC_BUILD_ENABLED; do
buildopt+=(-e $bo)
done
for bo in $FC_BUILD_DISABLED; do
buildopt+=(-d $bo)
done
[ -n "$FC_BUILD_ARCH" ] && buildopt+=(-a $FC_BUILD_ARCH)
[ $FC_BUILD_DISTCHECK -eq 1 ] && buildopt+=(-c)
[ $FC_BUILD_NO_INSTALL -eq 1 ] && buildopt+=(-I)
buildopt+=(-s $FC_BUILDSYS)
buildopt+=(-t $FC_BUILD_TYPE)
buildopt+=(-X $FC_XML_BACKEND)
sh .gitlab-ci/build.sh ${buildopt[*]}
variables:
FC_BUILDSYS: autotools
FC_XML_BACKEND: expat
FC_BUILD_TYPE: both
FC_BUILD_DISTCHECK: 0
FC_BUILD_NO_INSTALL: 0
.fc_artifacts:
artifacts:
name: fontconfig-$CI_COMMIT_SHA-$CI_JOB_ID
when: always
expire_in: 5 days
paths:
- fc-build.log
- build-*/fontconfig-*.tar.*
- build-*/fontconfig*/_build
#######################################
# #
# test stage #
# #
#######################################
{% for distro in distributions %}
{% for version in distro.versions %}
2023-04-06 09:46:54 +02:00
{% for build in distro.builds %}
2023-04-06 09:46:54 +02:00
t_{{distro.name}}:{{version}}:{{build.name}}:
extends:
2023-04-06 09:46:54 +02:00
- .build@template
- .fdo.distribution-image@{{distro.name}}
- .fc_artifacts
variables:
2023-04-06 09:46:54 +02:00
FC_DISTRO_NAME: {{distro.name}}
FDO_DISTRIBUTION_VERSION: '{{version}}'
FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
{# Where we have extra_variables defined, add them to the list #}
2023-04-06 09:46:54 +02:00
{% if build.variables is defined %}
{% for key, value in build.variables.items() %}
{{key}}: {{value}}
{% endfor %}
{% endif %}
needs:
- '{{distro.name}}:{{version}}@container-prep'
{% endfor %}
{% endfor %}
{% endfor %}
2023-04-06 09:46:54 +02:00