summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 67d649b6dde0fbfa18e2eba4db5a6de39e4e52b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0 filetype=yaml:
#
# This CI uses the freedesktop.org ci-templates.
# Please see the ci-templates documentation for details:
# https://freedesktop.pages.freedesktop.org/ci-templates/

.templates_sha: &template_sha c7702b1ae8507c5d5f34edcbf280f287ab541e8e # see https://docs.gitlab.com/ee/ci/yaml/#includefile


include:
  # Alpine container builder template
  - project: 'freedesktop/ci-templates'
    ref: *template_sha
    file: '/templates/alpine.yml'


stages:
  - prep             # prep work like rebuilding the container images if there is a change
  - build            # for actually building and testing things in a container
  - deploy


variables:
  FDO_UPSTREAM_REPO: 'libevdev/evtest'
  # The tag should be updated each time the list of packages is updated.
  # Changing a tag forces the associated image to be rebuilt.
  # Note: the tag has no meaning, we use a date format purely for readability
  ALPINE_TAG:  '2020-11-16.0'
  ALPINE_PACKAGES:  'git gcc autoconf automake make libc-dev linux-headers gzip xmlto asciidoc'

#
# Build a container with the given tag and the packages pre-installed.
# This only happens if when the tag changes, otherwise the existing image is
# re-used.
#
container-prep:
  extends:
    - .fdo.container-build@alpine
  stage: prep
  variables:
    GIT_STRATEGY: none
    FDO_DISTRIBUTION_PACKAGES: $ALPINE_PACKAGES
    FDO_DISTRIBUTION_TAG: $ALPINE_TAG


#
# The default build, runs on the image built above.
#
build-autotools:
  stage: build
  extends:
    - .fdo.distribution-image@alpine
  script:
    - autoreconf -ivf
    - mkdir _builddir
    - pushd _builddir > /dev/null
    - ../configure --disable-silent-rules
    - make
    - make check
    - make distcheck
    - popd > /dev/null
  variables:
    FDO_DISTRIBUTION_TAG: $ALPINE_TAG


#
# Pure gcc build, runs on the image built above.
#
compile-only:
  stage: build
  extends:
    - .fdo.distribution-image@alpine
  script:
    - gcc -o evtest evtest.c
  variables:
    FDO_DISTRIBUTION_TAG: $ALPINE_TAG