forked from nasa/cFS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
126 lines (123 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
os: linux
dist: bionic
language: c
compiler:
- gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- cmake cppcheck doxygen lcov graphviz
env:
global:
- SIMULATION=native
- ENABLE_UNIT_TESTS=true
- DEPLOY_DIR=$TRAVIS_BUILD_DIR/deploy
jobs:
- BUILDTYPE=release OMIT_DEPRECATED=true
- BUILDTYPE=release OMIT_DEPRECATED=false
- BUILDTYPE=debug OMIT_DEPRECATED=true
- BUILDTYPE=debug OMIT_DEPRECATED=false
# Build the pdfs and copy to the deploy directory
before_deploy:
- sudo apt-get install texlive-latex-base texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra
- mkdir $DEPLOY_DIR
- cd $TRAVIS_BUILD_DIR/build/doc/users_guide/latex
- make > build.txt
- cp refman.pdf $DEPLOY_DIR/cFE_Users_Guide.pdf
- cd $TRAVIS_BUILD_DIR/build/doc/osalguide/latex
- make > build.txt
- cp refman.pdf $DEPLOY_DIR/OSAL_Users_Guide.pdf
- cd $TRAVIS_BUILD_DIR
# Deploy documentation to github pages
deploy:
provider: pages
strategy: git
cleanup: false
token: $GITHUB_TOKEN # Set in personal repository, as a secure variable
keep_history: false
local_dir: $DEPLOY_DIR
on:
condition: $BUILDTYPE = release && $OMIT_DEPRECATED = false
edge: true
script:
# Check versions
- cppcheck --version
# Setup standard permissive build
- cp cfe/cmake/Makefile.sample Makefile
- cp -r cfe/cmake/sample_defs sample_defs
# Static code analysis
# Below is intent but fails - exit code bug in cppcheck 1.82
# - cppcheck --force --inline-suppr --quiet --error-exitcode=1 .
# Work around script:
- cppcheck --force --inline-suppr --quiet . 2> cppcheck_err.txt
- |
if [[ -s cppcheck_err.txt ]]; then
echo "You must fix cppcheck errors before submitting a pull request"
echo ""
cat cppcheck_err.txt
exit -1
fi
# Prep and build
- make prep
- make
- make install
# Run unit tests and generate coverage results
- make test
- make lcov
# Eventually check/enforce minimum coverage
# Make documentation
- make doc > make_doc_stdout.txt 2> make_doc_stderr.txt
- |
if [[ -s make_doc_stderr.txt ]]; then
echo "You must fix doxygen errors for \"doc\" before submitting a pull request"
echo ""
cat make_doc_stderr.txt
exit -1
fi
# Eventually enforce no doxygen warnings
- make usersguide > make_usersguide_stdout.txt 2> make_usersguide_stderr.txt
- |
if [[ -s make_usersguide_stderr.txt ]]; then
echo "You must fix doxygen errors for \"usersguide\" before submitting a pull request"
echo ""
cat make_usersguide_stderr.txt
exit -1
fi
- |
if [[ -s build/doc/warnings.log ]]; then
echo "You must fix doxygen warnings for \"usersguide\" before submitting a pull request"
echo ""
cat build/doc/warnings.log
exit -1
fi
- make osalguide > make_osalguide_stdout.txt 2> make_osalguide_stderr.txt
- |
if [[ -s make_osalguide_stderr.txt ]]; then
echo "You must fix doxygen errors for \"osalguide\" before submitting a pull request"
echo ""
cat make_osalguide_stderr.txt
exit -1
fi
- |
if [[ -s build/doc/warnings.log ]]; then
echo "You must fix doxygen warnings for \"osalguide\" before submitting a pull request"
echo ""
cat build/doc/warnings.log
exit -1
fi
# List cpu1 for core binary
- ls build/exe/cpu1/
# Start cFE (pipe output to file), pause, send reset command, check outputs
- cd build/exe/cpu1
- ./core-cpu1 > cFS_startup.txt &
- sleep 30
- ../host/cmdUtil --endian=LE --pktid=0x1806 --cmdcode=2 --half=0x0002
- |
if [[ -n $(grep -i "warn\|err\|fail" cFS_startup.txt) ]]; then
echo "Must resolve warn|err|fail in cFS startup before submitting a pull request"
echo ""
grep -i 'warn\|err\|fail' cFS_startup.txt
exit -1
fi