forked from clearlinux/swupd-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
83 lines (77 loc) · 4.83 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
sudo: required
dist: xenial
language: c
stages:
- "Static Analysis"
- test
env:
global:
- MAKEFLAGS="-j 2"
- UPDATE_TOTAL="$(find test/functional/update -name *.bats | wc -l)"
- UPDATE_SUBGROUP1_TOTAL=17
- UPDATE_SUBGROUP2_TOTAL="$((UPDATE_TOTAL - UPDATE_SUBGROUP1_TOTAL))"
- UPDATE_SUBGROUP1="$(find test/functional/update -name *.bats | head -n $UPDATE_SUBGROUP1_TOTAL | tr '\n' ' ')"
- UPDATE_SUBGROUP2="$(find test/functional/update -name *.bats | tail -n $UPDATE_SUBGROUP2_TOTAL | tr '\n' ' ')"
- GROUP1="$UPDATE_SUBGROUP1"
- GROUP2="$UPDATE_SUBGROUP2 $(find test/functional/{checkupdate,hashdump,mirror,usability} -name *.bats \( ! -name usa-config-file.bats \) -printf '%p ')"
- GROUP3="$(find test/functional/{diagnose,search,os-install,repair} -name *.bats -printf '%p ')"
- GROUP4="$(find test/functional/{bundleadd,bundleremove,bundlelist,signature} -name *.bats -printf '%p ')"
# The config file cannot be isolated to a test environment, so tests related to it have to run separate
- CONFIG_FILE_TESTS="$(find test/functional/usability -name usa-config-file.bats -printf '%p ')"
jobs:
include:
- stage: "Static Analysis"
name: "Static Analysis & Unit Tests"
script: make compliant && make shellcheck && make check-flags && sudo sh -c 'umask 0022 && make unit-check' && make docs-coverage
- stage: test
name: "Functional Tests - update (group 1)"
script: env TESTS="$GROUP1" make -e check
- stage: test
name: "Functional Tests - update (group 2), checkupdate, hashdump, mirror, usability"
script: env TESTS="$GROUP2" make -e check && env TESTS="$CONFIG_FILE_TESTS" make -e check
- stage: test
name: "Functional Tests - diagnose, os-install, repair, search"
script: env TESTS="$GROUP3" make -e check
- stage: test
name: "Functional Tests - bundle-add, bundle-remove, bundle-list, signature"
script: env TESTS="$GROUP4" make -e check
# Pre-install missing build dependencies:
# - libcheck 0.9.10 is slightly too old, since 0.9.12 adds TAP support
# - bsdiff 1.* is the Clear Linux OS fork
# - libcurl 7.35.0 is too old. Installing a newer version.
# - the Swupd_Root.pem cert must be installed out-of-tree to run the test suite with signature verification enabled
# - python3-docutils for the rst2man script
install:
- wget https://github.com/libcheck/check/releases/download/0.11.0/check-0.11.0.tar.gz
- tar -xvf check-0.11.0.tar.gz
- pushd check-0.11.0 && ./configure --prefix=/usr && make -j48 && sudo make install && popd
- wget https://github.com/clearlinux/bsdiff/releases/download/v1.0.2/bsdiff-1.0.2.tar.xz
- tar -xvf bsdiff-1.0.2.tar.xz
- pushd bsdiff-1.0.2 && ./configure --prefix=/usr --disable-tests && make -j48 && sudo make install && popd
- wget https://curl.haxx.se/download/curl-7.64.0.tar.gz
- tar -xvf curl-7.64.0.tar.gz
- pushd curl-7.64.0 && ./configure --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu && make -j48 && sudo make install && popd
- wget https://download.clearlinux.org/releases/13010/clear/Swupd_Root.pem
- sudo install -D -m0644 Swupd_Root.pem /usr/share/clear/update-ca/Swupd_Root.pem
- wget https://github.com/libarchive/libarchive/archive/v3.3.1.tar.gz
- tar -xvf v3.3.1.tar.gz
- pushd libarchive-3.3.1 && autoreconf -fi && ./configure --prefix=/usr && make -j48 && sudo make install && popd
- sudo apt-get install python3-docutils
- sudo apt-get install realpath
- sudo apt-get install clang-format-6.0
- sudo apt-get install shellcheck
- sudo apt-get install doxygen
- sudo pip install coverxygen
- sudo ln -s /usr/share/docutils/scripts/python3/rst2man /usr/bin/rst2man.py
- git fetch origin master:refs/remotes/origin/master #Download origin/master for shelcheck
# Ubuntu's default umask is 0002, but this break's swupd hash calculations.
before_script:
- autoreconf --verbose --warnings=none --install --force
- ./configure CFLAGS="$CFLAGS -fsanitize=address -Werror" --prefix=/usr --with-fallback-capaths=$TRAVIS_BUILD_DIR/swupd_test_certificates --with-systemdsystemunitdir=/usr/lib/systemd/system --with-config-file-path=./testconfig
- sudo find test/functional -exec chmod g-w {} \;
- make &&
sudo sh -c 'umask 0022 && make install' &&
sudo sh -c 'umask 0022 && make install-check' &&
sh -c 'make check-test-ids'
after_failure:
- cat test-suite.log