Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3992993

Browse files
committed
Change travis configuration
1 parent ad285a9 commit 3992993

File tree

3 files changed

+33
-36
lines changed

3 files changed

+33
-36
lines changed

.travis.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ script:
1717
- docker-compose run tests
1818

1919
env:
20-
- PG_VERSION=10 CHECK_CODE=true COMPILER=clang
21-
- PG_VERSION=9.6 CHECK_CODE=true COMPILER=clang
22-
- PG_VERSION=9.5 CHECK_CODE=true COMPILER=clang
23-
- PG_VERSION=10 CHECK_CODE=true COMPILER=gcc
24-
- PG_VERSION=10 CHECK_CODE=false COMPILER=gcc
25-
- PG_VERSION=9.6 CHECK_CODE=true COMPILER=gcc
26-
- PG_VERSION=9.6 CHECK_CODE=false COMPILER=gcc
27-
- PG_VERSION=9.5 CHECK_CODE=true COMPILER=gcc
28-
- PG_VERSION=9.5 CHECK_CODE=false COMPILER=gcc
20+
- PG_VERSION=10 CHECK_CODE=clang
21+
- PG_VERSION=9.6 CHECK_CODE=clang
22+
- PG_VERSION=9.5 CHECK_CODE=clang
23+
- PG_VERSION=10 CHECK_CODE=cppcheck
24+
- PG_VERSION=10 CHECK_CODE=false
25+
- PG_VERSION=9.6 CHECK_CODE=cppcheck
26+
- PG_VERSION=9.6 CHECK_CODE=false
27+
- PG_VERSION=9.5 CHECK_CODE=cppcheck
28+
- PG_VERSION=9.5 CHECK_CODE=false
2929

3030
after_success:
3131
- bash <(curl -s https://codecov.io/bash)

Dockerfile.tmpl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ ENV LANG=C.UTF-8 PGDATA=/pg/data
44

55
RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.6/main' > /etc/apk/repositories && \
66
echo 'http://dl-cdn.alpinelinux.org/alpine/v3.6/community' >> /etc/apk/repositories && \
7-
apk --no-cache add python3 gcc make musl-dev cppcheck ${COMPILER} && \
7+
apk --no-cache add python3 gcc make musl-dev cppcheck && \
8+
apk --no-cache add clang-analyzer --repository http://dl-3.alpinelinux.org/alpine/edge/main/ && \
89
pip3 install testgres && \
910
mkdir -p /pg/data && \
1011
mkdir /pg/pg_pathman && \
@@ -16,4 +17,4 @@ ADD . /pg/pg_pathman
1617
WORKDIR /pg/pg_pathman
1718
RUN chmod -R go+rwX /pg/pg_pathman
1819
USER postgres
19-
ENTRYPOINT PGDATA=${PGDATA} COMPILER=${COMPILER} CHECK_CODE=${CHECK_CODE} bash run_tests.sh
20+
ENTRYPOINT PGDATA=${PGDATA} CHECK_CODE=${CHECK_CODE} bash run_tests.sh

run_tests.sh

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,33 @@
22

33
set -eux
44

5-
echo COMPILER=$COMPILER
65
echo CHECK_CODE=$CHECK_CODE
76
echo PG_VERSION=$PG_VERSION
87

98
# perform code analysis if necessary
10-
if [ $CHECK_CODE = "true" ]; then
11-
12-
if [ "$COMPILER" = "clang" ]; then
13-
scan-build --status-bugs make USE_PGXS=1 || status=$?
14-
exit $status
15-
16-
elif [ "$COMPILER" = "gcc" ]; then
17-
cppcheck --template "{file} ({line}): {severity} ({id}): {message}" \
18-
--enable=warning,portability,performance \
19-
--suppress=redundantAssignment \
20-
--suppress=uselessAssignmentPtrArg \
21-
--suppress=incorrectStringBooleanError \
22-
--std=c89 src/*.c src/*.h 2> cppcheck.log
23-
24-
if [ -s cppcheck.log ]; then
25-
cat cppcheck.log
26-
status=1 # error
27-
fi
28-
29-
exit $status
30-
fi
31-
32-
# don't forget to "make clean"
33-
make USE_PGXS=1 clean
9+
if [ "$CHECK_CODE" = "clang" ]; then
10+
scan-build --status-bugs make USE_PGXS=1 || status=$?
11+
exit $status
12+
13+
elif [ "$CHECK_CODE" = "cppcheck" ]; then
14+
cppcheck --template "{file} ({line}): {severity} ({id}): {message}" \
15+
--enable=warning,portability,performance \
16+
--suppress=redundantAssignment \
17+
--suppress=uselessAssignmentPtrArg \
18+
--suppress=incorrectStringBooleanError \
19+
--std=c89 src/*.c src/include/*.h 2> cppcheck.log
20+
21+
if [ -s cppcheck.log ]; then
22+
cat cppcheck.log
23+
status=1 # error
24+
fi
25+
26+
exit $status
3427
fi
3528

29+
# don't forget to "make clean"
30+
make USE_PGXS=1 clean
31+
3632
# initialize database
3733
initdb
3834

0 commit comments

Comments
 (0)