summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 83d27d057137bb0ef38757fbb3068f6eb8cfdcf7 (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
image: fedora:latest
before_script:
  - dnf update -y
  - dnf install -y gcc meson automake libtool make pkgconfig autoconf-archive nss-devel glib2-devel opensc gnutls-utils nss-tools openssl softhsm lcov valgrind libasan clang csbuild which xz

Fedora meson:
  stage: build
  script:
    - meson build --buildtype=release -Db_coverage=true
    - ninja -C build
    - meson test -C build
    - meson dist -C build
    - ninja coverage -C build
  artifacts:
    expire_in: '1 week'
    when: always
    paths:
      - build/meson-logs/
    reports:
      junit: build/meson-logs/testlog.junit.xml

.ubuntu:
  image: ubuntu:latest
  before_script:
    - export DEBIAN_FRONTEND=noninteractive
    - apt-get update -y
    - apt-get install -y libglib2.0-dev libnss3-dev  pkgconf libtool make autoconf autoconf-archive automake libsofthsm2-dev softhsm2 softhsm2-common help2man gnutls-bin libcmocka-dev libusb-dev libudev-dev flex libnss3-tools libssl-dev libpcsclite1 opensc openssl

Ubuntu build:
  extends: .ubuntu
  stage: build
  script:
    - ./autogen.sh
    - make

Ubuntu 16.04 build (oss-fuzz):
  extends: .ubuntu
  image: ubuntu:16.04
  stage: build
  script:
    - ./autogen.sh
    - make

.centos7:
  image: centos:7
  before_script:
    - yum update -y
    - yum install -y gcc automake libtool make pkgconfig autoconf-archive nss-devel glib2-devel opensc gnutls-utils nss-tools openssl softhsm lcov valgrind libasan clang csbuild which

CentOS 7 build:
  extends: .centos7
  stage: build
  script:
    - ./autogen.sh
    - make

CentOS 7 build and check:
  extends: .centos7
  stage: test
  script:
    - ./autogen.sh
    - make check
    - make dist
  artifacts:
    expire_in: '1 week'
    when: always
    paths:
      - test-suite.log

Ubuntu build and check:
  extends: .ubuntu
  stage: test
  script:
    - ./autogen.sh
    - make check
    - make dist
  artifacts:
    expire_in: '1 week'
    when: always
    paths:
      - test-suite.log

Fedora build:
  stage: build
  script:
    - ./autogen.sh
    - make

Fedora build and check:
  stage: test
  script:
    - ./autogen.sh --enable-code-coverage
    - make check
    - make code-coverage-capture
    - lcov --summary libcacard-*-coverage.info
    - make dist
  artifacts:
    expire_in: '1 week'
    when: always
    paths:
      - test-suite.log
      - libcacard-*-coverage

Fedora memcheck:
  stage: test
  script:
    - ./autogen.sh
    - make memcheck-local
  allow_failure: true

Fedora asan:
  stage: test
  variables:
    ASAN_OPTIONS: fast_unwind_on_malloc=false
    LSAN_OPTIONS: suppressions=suppr.txt
  script:
    - ./autogen.sh
    - make CFLAGS="-fsanitize=address" check || (cat test-suite.log && exit 1)
  artifacts:
    expire_in: '1 week'
    when: always
    paths:
      - test-suite.log

Fedora clang:
  stage: build
  variables:
    CC: clang
  script:
    - ./autogen.sh
    - make
  artifacts:
    expire_in: '1 week'
    when: always
    paths:
      - test-suite.log
  allow_failure: true

Fedora csbuild:
  stage: test
  script:
    - csbuild
      --prep-cmd="./autogen.sh"
      --build-cmd "make clean && make"
      --color
      --print-current

pages:
  stage: deploy
  dependencies:
    - Fedora meson
  script:
    - mv build/meson-logs/coveragereport/ public/
  artifacts:
    expire_in: 30 days
    when: always
    paths:
      - public
  only:
    - master