forked from huskyproject/hpt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
105 lines (101 loc) · 3.81 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
os: linux
dist: bionic
language: c
jobs:
include:
- os: linux
language: c
env:
- MATRIX_EVAL="CC=gcc" CF=-DBUILD_SHARED_LIBS=OFF ARCH="x86_64" DEPLOY="true"
- os: linux
language: c
env:
- MATRIX_EVAL="CC=gcc" CF="-DBUILD_SHARED_LIBS=ON" ARCH="x86_64"
DEPLOY="false"
before_install:
- sudo apt-get install -y rpm
- git clone https://github.com/huskyproject/huskylib ~/build/huskyproject/huskylib
- git clone https://github.com/huskyproject/smapi ~/build/huskyproject/smapi
- git clone https://github.com/huskyproject/fidoconf ~/build/huskyproject/fidoconf
- git clone https://github.com/huskyproject/hptzip ~/build/huskyproject/hptzip
- git clone https://github.com/huskyproject/areafix ~/build/huskyproject/areafix
- if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-install-recommends
--no-upgrade -qq $PACKAGES; fi
- wget -q -O - https://files.viva64.com/etc/pubkey.txt | sudo apt-key add -
- sudo wget -O /etc/apt/sources.list.d/viva64.list https://files.viva64.com/etc/viva64.list
- sudo apt-get update; sudo apt-get install -y pvs-studio
script:
- echo TRAVIS_BRANCH=$TRAVIS_BRANCH
- echo TRAVIS_TAG=$TRAVIS_TAG
- if [[ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" && "$TRAVIS_BRANCH" != "master" ]]; then CURR_BRANCH="$TRAVIS_BRANCH"; fi
- echo CURR_BRANCH=$CURR_BRANCH
- eval "${MATRIX_EVAL}"
- cd ~/build/huskyproject/huskylib
- if [[ -n "$CURR_BRANCH" ]]; then git checkout "$CURR_BRANCH"; true; fi
- git branch
- mkdir build
- cd build
- cmake .. ${CF}
- cmake --build .
- sudo make install
- cd ~/build/huskyproject/smapi
- if [[ -n "$CURR_BRANCH" ]]; then git checkout "$CURR_BRANCH"; true; fi
- git branch
- mkdir build
- cd build
- cmake .. ${CF}
- cmake --build .
- sudo make install
- cd ~/build/huskyproject/fidoconf
- if [[ -n "$CURR_BRANCH" ]]; then git checkout "$CURR_BRANCH"; true; fi
- git branch
- mkdir build
- cd build
- cmake .. ${CF}
- cmake --build .
- sudo make install
- cd ~/build/huskyproject/areafix
- if [[ -n "$CURR_BRANCH" ]]; then git checkout "$CURR_BRANCH"; true; fi
- git branch
- mkdir build
- cd build
- cmake .. ${CF}
- cmake --build .
- sudo make install
- cd ~/build/huskyproject/hptzip
- if [[ -n "$CURR_BRANCH" ]]; then git checkout "$CURR_BRANCH"; true; fi
- git branch
- mkdir build
- cd build
- cmake .. ${CF}
- cmake --build .
- sudo make install
- cd $TRAVIS_BUILD_DIR
- git branch
- if [[ -n "$PVS_USERNAME" ]]; then pvs-studio-analyzer credentials -o $TRAVIS_BUILD_DIR/PVS-Studio.lic $PVS_USERNAME $PVS_KEY; fi
- if [[ -n "$PVS_USERNAME" ]]; then cmake . -Bbuild "${CF}" -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DCPACK_DEBIAN_PACKAGE_MAINTAINER=travis-ci; fi
- if [[ -z "$PVS_USERNAME" ]]; then cmake . -Bbuild "${CF}" -DCPACK_DEBIAN_PACKAGE_MAINTAINER=travis-ci; fi
- if [[ -n "$PVS_USERNAME" ]]; then pvs-studio-analyzer trace -- cmake --build build; else cmake --build build; fi
- if [[ -n "$PVS_USERNAME" ]]; then pvs-studio-analyzer analyze -l $TRAVIS_BUILD_DIR/PVS-Studio.lic -s $TRAVIS_BUILD_DIR/suppress_base.json -o build/pvs.log; fi
- if [[ -n "$PVS_USERNAME" ]]; then plog-converter -a 'GA:1,2;64:1,2;OP:1,2' -t tasklist -o build/pvs.tasks build/pvs.log; fi
- if [[ -n "$PVS_USERNAME" ]]; then cat build/pvs.tasks; fi
- if [[ -n "$PVS_USERNAME" ]]; then ! grep -vP '\serr\s+Help:' build/pvs.tasks | grep -P '\serr\s'; fi
- cd build
- cpack
- cpack -G RPM
- cpack -G DEB
- for file in *.rpm; do mv $file $(basename $file .rpm).${ARCH}.rpm; done
- for file in *.deb; do mv $file $(basename $file .deb).${ARCH}.deb; done
- for file in *.tar.gz; do mv $file $(basename $file .tar.gz).${ARCH}.tar.gz; done
deploy:
provider: releases
token: $GITHUB_OAUTH_TOKEN
file_glob: true
file:
- $TRAVIS_BUILD_DIR/build/*.rpm
- $TRAVIS_BUILD_DIR/build/*.deb
- $TRAVIS_BUILD_DIR/build/*.tar.gz
on:
tags: true
branch: master
condition: $DEPLOY="true"