Skip to content

Commit 5ae001a

Browse files
committed
CI update to mimic aws-c-io
1 parent c66718d commit 5ae001a

19 files changed

+112
-62
lines changed

.clang-format

-1
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,3 @@ Standard: Cpp11
5555
TabWidth: 4
5656
UseTab: Never
5757
...
58-

.clang-tidy

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
Checks: 'clang-diagnostic-*,clang-analyzer-*,readability-*,modernize-*,bugprone-*,misc-*,google-runtime-int,llvm-header-guard,fuchsia-restrict-system-includes,-clang-analyzer-valist.Uninitialized,-clang-analyzer-security.insecureAPI.rand,-clang-analyzer-alpha.*'
2+
Checks: 'clang-diagnostic-*,clang-analyzer-*,readability-*,modernize-*,bugprone-*,misc-*,google-runtime-int,fuchsia-restrict-system-includes,-clang-analyzer-valist.Uninitialized,-clang-analyzer-security.insecureAPI.rand,-clang-analyzer-alpha.*'
33
WarningsAsErrors: '*'
44
HeaderFilterRegex: '\./*'
55
FormatStyle: 'file'
@@ -12,4 +12,4 @@ CheckOptions:
1212
- key: fuchsia-restrict-system-includes.Includes
1313
value: '*,-stdint.h,-stdbool.h'
1414

15-
...
15+
...

.travis.yml

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1-
sudo: false
1+
sudo: true
22
language: c
33

44
osx_image: xcode8
55

6+
#run builds for linux and osx. will add windows shortly
67
os:
7-
- osx
8+
# - osx add osx back when travis fixes their mac os scaling problems.
9+
- linux
810

11+
#run builds on both gcc and clang
912
compiler:
13+
- gcc
1014
- clang
1115

16+
install:
17+
- sudo apt-get install -qq cppcheck
18+
1219
#execute build
1320
script:
14-
- ./codebuild/common-macos.sh
21+
- .travis/travis_build.sh

.travis/travis_build.sh

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License").
5+
# You may not use this file except in compliance with the License.
6+
# A copy of the License is located at
7+
#
8+
# http://aws.amazon.com/apache2.0
9+
#
10+
# or in the "license" file accompanying this file. This file is distributed
11+
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
# express or implied. See the License for the specific language governing
13+
# permissions and limitations under the License.
14+
#
15+
set -e
16+
17+
PROJECT_DIR=`pwd`
18+
cd ..
19+
20+
#build aws-c-common
21+
git clone https://github.com/awslabs/aws-c-common.git
22+
mkdir common-build && cd common-build
23+
cmake ../aws-c-common
24+
make && make test
25+
cd ..
26+
27+
#build s2n
28+
git clone https://github.com/awslabs/s2n.git
29+
mkdir s2n-build && cd s2n-build
30+
cmake ../s2n
31+
make && make test
32+
cd ..
33+
34+
#build aws-c-io
35+
cd $PROJECT_DIR
36+
cppcheck --enable=all --std=c99 --language=c --suppress=unusedFunction -I include ../aws-c-common/include --force --error-exitcode=-1 ./
37+
cd ..
38+
mkdir build && cd build
39+
cmake -Ds2n_DIR="../s2n-build" -Daws-c-common_DIR="../common-build" $PROJECT_DIR
40+
make && make test

CMakeLists.txt

-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ include(AwsCFlags)
77
include(Sanitizers)
88
include(CheckCCompilerFlag)
99

10-
option(BUILD_PORTABLE_BINARIES
11-
"Build Relocatable Binaries, this will turn off features that will fail on older kernels than used for the build."
12-
OFF)
13-
1410
file(GLOB AWS_HTTP_HEADERS
1511
"include/aws/http/*.h"
1612
)

codebuild/common-linux.sh

+22-12
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,38 @@
11
#!/bin/bash
22

3-
cd ../
3+
set -e
44

5-
mkdir install
5+
CMAKE_ARGS="$@"
66

7-
git clone https://github.com/awslabs/aws-c-common.git
8-
cd aws-c-common
9-
mkdir build
10-
cd build
7+
function install_library {
8+
git clone https://github.com/awslabs/$1.git
9+
cd $1
10+
mkdir build
11+
cd build
12+
13+
cmake -DCMAKE_INSTALL_PREFIX=../../install -DENABLE_SANITIZERS=ON $CMAKE_ARGS ../
14+
make install
15+
16+
cd ../..
17+
}
1118

12-
cmake -DCMAKE_INSTALL_PREFIX=../../install -DENABLE_SANITIZERS=ON $@ ../
13-
make install
1419

15-
cd ../..
20+
cd ../
21+
22+
mkdir install
23+
24+
install_library s2n
25+
install_library aws-c-common
1626

17-
cd aws-c-http
27+
cd aws-c-io
1828
mkdir build
1929
cd build
20-
cmake -DCMAKE_INSTALL_PREFIX=../../install -DENABLE_SANITIZERS=ON $@ ../
30+
cmake -DCMAKE_INSTALL_PREFIX=../../install -DENABLE_SANITIZERS=ON $CMAKE_ARGS ../
2131

2232
make
2333

2434
LSAN_OPTIONS=verbosity=1:log_threads=1 ctest --output-on-failure
2535

2636
cd ..
2737

28-
./cppcheck.sh ../install/include
38+
# ./cppcheck.sh ../install/include

codebuild/common-macos.sh

+18-12
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,31 @@
44

55
set -e
66

7-
cd ../
7+
CMAKE_ARGS="$@"
88

9-
mkdir install
9+
function install_library {
10+
git clone https://github.com/awslabs/$1.git
11+
cd $1
12+
mkdir build
13+
cd build
1014

11-
git clone https://github.com/awslabs/aws-c-common.git
12-
cd aws-c-common
13-
mkdir build
14-
cd build
15+
cmake -DCMAKE_INSTALL_PREFIX=../../install -DENABLE_SANITIZERS=ON $CMAKE_ARGS ../
16+
make install
17+
18+
cd ../..
19+
}
1520

16-
cmake -DCMAKE_INSTALL_PREFIX=../../install -DENABLE_SANITIZERS=ON $@ ../
17-
make install
21+
cd ../
22+
23+
mkdir install
1824

19-
cd ../..
25+
install_library aws-c-common
2026

21-
cd aws-c-http
27+
cd aws-c-io
2228
mkdir build
2329
cd build
24-
cmake -DCMAKE_INSTALL_PREFIX=../../install -DENABLE_SANITIZERS=ON $@ ../
30+
cmake -DCMAKE_INSTALL_PREFIX=../../install -DENABLE_SANITIZERS=ON $CMAKE_ARGS ../
2531

2632
make
2733

28-
LSAN_OPTIONS=verbosity=1:log_threads=1 ctest --output-on-failure
34+
LSAN_OPTIONS=verbosity=1:log_threads=1 ctest --output-on-failure

codebuild/common-windows.bat

+16-14
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
1-
21
cd ../
2+
set CMAKE_ARGS=%*
3+
34
mkdir install
45

5-
git clone https://github.com/awslabs/aws-c-common.git
6-
cd aws-c-common
7-
mkdir build
8-
cd build
9-
cmake %* -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX=../../install ../ || goto error
10-
msbuild.exe aws-c-common.vcxproj /p:Configuration=Release || goto error
11-
msbuild.exe INSTALL.vcxproj /p:Configuration=Release || goto error
12-
ctest -V || goto error
13-
cd ../..
6+
CALL :install_library aws-c-common
147

15-
cd aws-c-http
8+
cd aws-c-io
169
mkdir build
1710
cd build
18-
cmake %* -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX=../../install ../ || goto error
19-
msbuild.exe aws-c-http.vcxproj /p:Configuration=Release || goto error
20-
msbuild.exe tests/aws-c-http-tests.vcxproj /p:Configuration=Release || goto error
11+
cmake %CMAKE_ARGS% -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX=../../install ../ || goto error
12+
cmake --build . --config Release || goto error
2113
ctest -V
2214

2315
goto :EOF
2416

17+
:install_library
18+
git clone https://github.com/awslabs/%~1.git
19+
cd %~1
20+
mkdir build
21+
cd build
22+
cmake %CMAKE_ARGS% -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX=../../install ../ || goto error
23+
cmake --build . --target install --config Release || goto error
24+
cd ../..
25+
exit /b %errorlevel%
26+
2527
:error
2628
echo Failed with error #%errorlevel%.
2729
exit /b %errorlevel%

codebuild/linux-clang3-x64.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ phases:
1414
commands:
1515
- echo Build started on `date`
1616
- ./codebuild/common-linux.sh -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
17-
- clang-tidy-3.9 -p=build **/*.c
17+
# - clang-tidy-3.9 -p=build **/*.c
1818
post_build:
1919
commands:
2020
- echo Build completed on `date`
21-

codebuild/linux-clang6-x64.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ phases:
1616
build:
1717
commands:
1818
- echo Build started on `date`
19-
- ./codebuild/common-linux.sh -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DENABLE_FUZZ_TESTS=ON
19+
- ./codebuild/common-linux.sh -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
2020
- clang-tidy-6.0 -p=build **/*.c
2121
- ./format-check.sh
2222
post_build:
2323
commands:
2424
- echo Build completed on `date`
25-

codebuild/linux-gcc-4x-x64.yml

-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ phases:
1515
post_build:
1616
commands:
1717
- echo Build completed on `date`
18-

codebuild/linux-gcc-4x-x86.yml

-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ phases:
1515
post_build:
1616
commands:
1717
- echo Build completed on `date`
18-

codebuild/linux-gcc-5x-x64.yml

-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ phases:
1616
post_build:
1717
commands:
1818
- echo Build completed on `date`
19-

codebuild/linux-gcc-6x-x64.yml

-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ phases:
1616
post_build:
1717
commands:
1818
- echo Build completed on `date`
19-

codebuild/linux-gcc-7x-x64.yml

-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ phases:
1616
post_build:
1717
commands:
1818
- echo Build completed on `date`
19-

codebuild/windows-msvc-2015-x86.yml

-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ phases:
44
build:
55
commands:
66
- .\codebuild\common-windows.bat -G "Visual Studio 14 2015"
7-

codebuild/windows-msvc-2015.yml

-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ phases:
44
build:
55
commands:
66
- .\codebuild\common-windows.bat -G "Visual Studio 14 2015 Win64"
7-

codebuild/windows-msvc-2017.yml

-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ phases:
44
build:
55
commands:
66
- .\codebuild\common-windows.bat -G "Visual Studio 15 2017 Win64"
7-

format-check.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/bash
22

33
if [[ -z $CLANG_FORMAT ]] ; then
44
CLANG_FORMAT=clang-format
@@ -21,4 +21,4 @@ do
2121
fi
2222
done
2323

24-
exit $FAIL
24+
exit $FAIL

0 commit comments

Comments
 (0)