forked from tpm2-software/tpm2-tss-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
122 lines (115 loc) · 4.02 KB
/
.travis.yml
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
language: c
compiler:
- gcc
- clang
dist: xenial
env:
matrix:
- OPENSSL_BRANCH=OpenSSL_1_0_2-stable TPM2TSS_BRANCH=3.0.x TPM2TOOLS_BRANCH=4.0
- OPENSSL_BRANCH=OpenSSL_1_1_0-stable TPM2TSS_BRANCH=3.0.x TPM2TOOLS_BRANCH=4.0
- OPENSSL_BRANCH=OpenSSL_1_1_1-stable TPM2TSS_BRANCH=3.0.x TPM2TOOLS_BRANCH=4.0
global:
- PATH="${PWD}/installdir/usr/local/bin:${PATH}"
- PKG_CONFIG_PATH="${PWD}/installdir/usr/local/lib/pkgconfig:/usr/lib/pkgconfig"
- LD_LIBRARY_PATH="${PWD}/installdir/usr/local/lib:/usr/lib"
addons:
apt:
packages:
- autoconf
- autoconf-archive
- automake
- build-essential
- libcmocka-dev
- libgcrypt20-dev
- realpath
- lcov
- libssl-dev
- uthash-dev
- pandoc
- expect
- doxygen
- libjson-c-dev
- libtasn1-dev
- socat
- python3-setuptools
- libseccomp-dev
install:
- git clean -xdf
- mkdir -p installdir/usr/local/bin
# TPM Simulator
- git clone --branch=v0.7.3 --depth=1 https://github.com/stefanberger/libtpms.git
- pushd libtpms
- autoreconf --install --force
- ./configure --prefix="$PWD/../installdir/usr/local" --with-openssl --with-tpm2
- make -j$(nproc) install
- popd
- git clone --branch=v0.4.1 --depth=1 https://github.com/stefanberger/swtpm.git
- pushd swtpm
- autoreconf --install --force
- ./configure --prefix="$PWD/../installdir/usr/local"
- make -j$(nproc) install
- popd
# OpenSSL 1.0.2 / 1.1.0
- git clone --branch $OPENSSL_BRANCH --depth=1 https://github.com/openssl/openssl.git
- pushd openssl
- ./config --prefix=${PWD}/../installdir/usr/local --openssldir=${PWD}/../installdir/usr/local/openssl shared
- make -j$(nproc)
- make install
- which openssl
- popd
# Autoconf archives
- wget --no-check-certificate https://download.01.org/tpm2/autoconf-archive-2017.09.28.tar.xz
# we skip failing cert check and use the sha256sum instead
- sha256sum autoconf-archive-2017.09.28.tar.xz | grep -q 5c9fb5845b38b28982a3ef12836f76b35f46799ef4a2e46b48e2bd3c6182fa01 || travis_terminate 1
- tar xJf autoconf-archive-2017.09.28.tar.xz
- cp autoconf-archive-2017.09.28/m4/ax_code_coverage.m4 m4/
# TPM2-TSS
- git clone --depth=1 -b ${TPM2TSS_BRANCH} https://github.com/tpm2-software/tpm2-tss.git
- pushd tpm2-tss
- cp ../autoconf-archive-2017.09.28/m4/ax_code_coverage.m4 m4/
- cp ../autoconf-archive-2017.09.28/m4/ax_is_release.m4 m4/
- cp ../autoconf-archive-2017.09.28/m4/ax_prog_doxygen.m4 m4/
- ./bootstrap
- ./configure CFLAGS=-I${PWD}/../installdir/usr/local/include LDFLAGS=-L${PWD}/../installdir/usr/local/lib --disable-doxygen-doc
- make -j$(nproc)
- make install DESTDIR=${PWD}/../installdir
- rm ${PWD}/../installdir/usr/local/lib/*.la
- popd
# tpm2-tools
- git clone --depth=1 -b ${TPM2TOOLS_BRANCH} https://github.com/tpm2-software/tpm2-tools.git
- pushd tpm2-tools
- mkdir m4 || true
- cp ../autoconf-archive-2017.09.28/m4/ax_code_coverage.m4 ../autoconf-archive-2017.09.28/m4/ax_is_release.m4 m4/
- ./bootstrap
# Some workarounds for tpm2-tools with -Wno-XXX
- ./configure --disable-hardening CFLAGS="-I${PWD}/../installdir/usr/local/include -Wno-unused-value -Wno-missing-field-initializer" LDFLAGS=-L${PWD}/../installdir/usr/local/lib
- make -j$(nproc)
- make install DESTDIR=${PWD}/../installdir
- popd
before_script:
- ./bootstrap
script:
# build with all tests enabled
- CONFIGURE_OPTIONS="CFLAGS=-I${PWD}/installdir/usr/local/include LDFLAGS=-L${PWD}/installdir/usr/local/lib "
- ./bootstrap
- mkdir ./build
- pushd ./build
- |
if [ "$CC" == "gcc" ]; then
export CONFIGURE_OPTIONS+=" --enable-code-coverage";
else
export SCAN_PREFIX="scan-build --status-bugs"
fi
- $SCAN_PREFIX ../configure $CONFIGURE_OPTIONS --enable-unit --enable-integration
- $SCAN_PREFIX make -j$(nproc)
- make -j$(nproc) check
- cat test-suite.log config.log
- ../configure $CONFIGURE_OPTIONS
- make -j$(nproc) distcheck
- cat config.log
- popd
after_success:
- |
if [ "$CC" == "gcc" ]; then
bash <(curl -s https://codecov.io/bash)
fi