Skip to content

continuous integration #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 4, 2019
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions codebuild/common-posix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

set -e

echo "Using CC=$CC CXX=$CXX"

BUILD_PATH=/tmp/builds
mkdir -p $BUILD_PATH
INSTALL_PATH=$BUILD_PATH/install
mkdir -p $INSTALL_PATH
CMAKE_ARGS="-DCMAKE_PREFIX_PATH=$INSTALL_PATH -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH $@"

# If TRAVIS_OS_NAME is OSX, skip this step (will resolve to empty string on CodeBuild)
if [ "$TRAVIS_OS_NAME" != "osx" ]; then
sudo apt-get install libssl-dev -y
fi

# build aws-crt-cpp
pushd $BUILD_PATH
git clone --branch v0.4.0 https://github.com/awslabs/aws-crt-cpp.git
cd aws-crt-cpp
cmake $CMAKE_ARGS -DBUILD_DEPS=ON ./
cmake --build . --target install
popd

# build SDK
mkdir -p build
pushd build
cmake $CMAKE_ARGS ../
cmake --build . --target install
popd
25 changes: 25 additions & 0 deletions codebuild/common-windows.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
set CMAKE_ARGS=%*

set BUILDS_DIR=%TEMP%\builds
set INSTALL_DIR=%BUILDS_DIR%\install
mkdir %BUILDS_DIR%
mkdir %INSTALL_DIR%

@rem build aws-crt-cpp
mkdir %BUILDS_DIR%\aws-crt-cpp-build
cd %BUILDS_DIR%\aws-crt-cpp-build
git clone --branch v0.4.0 https://github.com/awslabs/aws-crt-cpp.git
cmake %CMAKE_ARGS% -DCMAKE_INSTALL_PREFIX="%INSTALL_DIR%" -DCMAKE_PREFIX_PATH="%INSTALL_DIR%" -DCMAKE_BUILD_TYPE="Release" -DBUILD_DEPS=ON aws-crt-cpp || goto error
cmake --build . --target install || goto error

@rem build SDK
mkdir %BUILDS_DIR%\aws-iot-device-sdk-cpp-v2-build
cd %BUILDS_DIR%\aws-iot-device-sdk-cpp-v2-build
cmake %CMAKE_ARGS% -DCMAKE_INSTALL_PREFIX="%INSTALL_DIR%" -DCMAKE_PREFIX_PATH="%INSTALL_DIR%" -DCMAKE_BUILD_TYPE="Release" %CODEBUILD_SRC_DIR% || goto error
cmake --build . || goto error

goto :EOF

:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%
22 changes: 22 additions & 0 deletions codebuild/linux-clang3-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 0.2
#this buildspec assumes the ubuntu 14.04 trusty image
phases:
install:
commands:
- sudo apt-get update -y
- sudo apt-get update
- sudo apt-get install clang-3.9 clang-tidy-3.9 -y

pre_build:
commands:
- export CC=clang-3.9
- export CXX=clang++-3.9
build:
commands:
- echo Build started on `date`
- ./codebuild/common-posix.sh -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- clang-tidy-3.9 -p=build **/*.c
post_build:
commands:
- echo Build completed on `date`

25 changes: 25 additions & 0 deletions codebuild/linux-clang6-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: 0.2
#this buildspec assumes the ubuntu 14.04 trusty image
phases:
install:
commands:
- curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test
- sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-6.0 main"
- sudo apt-get update -y
- sudo apt-get install clang-6.0 clang-tidy-6.0 clang-format-6.0 -y -f

pre_build:
commands:
- export CC=clang-6.0
- export CXX=clang++-6.0
- export CLANG_FORMAT=clang-format-6.0
build:
commands:
- echo Build started on `date`
- ./codebuild/common-posix.sh -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- ./format-check.sh
post_build:
commands:
- echo Build completed on `date`

19 changes: 19 additions & 0 deletions codebuild/linux-gcc-4x-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 0.2
#this build spec assumes the ubuntu 14.04 trusty image
phases:
install:
commands:
- sudo apt-get update -y
- sudo apt-get install gcc g++ -y
pre_build:
commands:
- export CC=gcc
- export CXX=g++
build:
commands:
- echo Build started on `date`
- ./codebuild/common-posix.sh
post_build:
commands:
- echo Build completed on `date`

36 changes: 36 additions & 0 deletions codebuild/linux-gcc-4x-x86.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: 0.2
#this build spec assumes the ubuntu 14.04 trusty image
phases:
install:
commands:
- sudo apt-get update -y
- sudo apt-get install gcc gcc-multilib g++ g++-multilib -y
# Build OpenSSL from source
- mkdir libcrypto-build
- cd libcrypto-build
- curl -LO https://www.openssl.org/source/openssl-1.1.0j.tar.gz
- tar -xzvf openssl-1.1.0j.tar.gz
- cd openssl-1.1.0j
- setarch i386 ./config -fPIC no-shared \
-m32 no-md2 no-rc5 no-rfc3779 no-sctp no-ssl-trace no-zlib \
no-hw no-mdc2 no-seed no-idea no-camellia\
no-bf no-ripemd no-dsa no-ssl2 no-ssl3 no-capieng \
-DSSL_FORBID_ENULL -DOPENSSL_NO_DTLS1 -DOPENSSL_NO_HEARTBEATS \
--prefix=/tmp/builds/install
- make -j 12
- make install_sw
- cd $CODEBUILD_SRC_DIR

pre_build:
commands:
- export CC=gcc
- export CXX=g++
build:
commands:
- echo Build started on `date`
- ./codebuild/common-posix.sh -DCMAKE_C_FLAGS="-m32" -DCMAKE_CXX_FLAGS="-m32"

post_build:
commands:
- echo Build completed on `date`

20 changes: 20 additions & 0 deletions codebuild/linux-gcc-5x-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 0.2
#this build spec assumes the ubuntu 14.04 trusty image
phases:
install:
commands:
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test
- sudo apt-get update -y
- sudo apt-get install gcc-5 g++-5 -y
pre_build:
commands:
- export CC=gcc-5
- export CXX=g++-5
build:
commands:
- echo Build started on `date`
- ./codebuild/common-posix.sh
post_build:
commands:
- echo Build completed on `date`

20 changes: 20 additions & 0 deletions codebuild/linux-gcc-6x-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 0.2
#this build spec assumes the ubuntu 14.04 trusty image
phases:
install:
commands:
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test
- sudo apt-get update -y
- sudo apt-get install gcc-6 g++-6 -y
pre_build:
commands:
- export CC=gcc-6
- export CXX=g++-6
build:
commands:
- echo Build started on `date`
- ./codebuild/common-posix.sh
post_build:
commands:
- echo Build completed on `date`

20 changes: 20 additions & 0 deletions codebuild/linux-gcc-7x-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 0.2
#this build spec assumes the ubuntu 14.04 trusty image
phases:
install:
commands:
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test
- sudo apt-get update -y
- sudo apt-get install gcc-7 g++-7 -y
pre_build:
commands:
- export CC=gcc-7
- export CXX=g++-7
build:
commands:
- echo Build started on `date`
- ./codebuild/common-posix.sh
post_build:
commands:
- echo Build completed on `date`

7 changes: 7 additions & 0 deletions codebuild/windows-msvc-2015-x86.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 0.2

phases:
build:
commands:
- .\codebuild\common-windows.bat -G "Visual Studio 14 2015"

7 changes: 7 additions & 0 deletions codebuild/windows-msvc-2015.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 0.2

phases:
build:
commands:
- .\codebuild\common-windows.bat -G "Visual Studio 14 2015 Win64"

7 changes: 7 additions & 0 deletions codebuild/windows-msvc-2017.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 0.2

phases:
build:
commands:
- .\codebuild\common-windows.bat -G "Visual Studio 15 2017 Win64"

2 changes: 1 addition & 1 deletion format-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if NOT type $CLANG_FORMAT 2> /dev/null ; then
fi

FAIL=0
SOURCE_FILES=`find discovery jobs shadow -type f \( -name '*.h' -o -name '*.cpp' \)`
SOURCE_FILES=`find discovery jobs shadow samples -type f \( -name '*.h' -o -name '*.cpp' \)`
for i in $SOURCE_FILES
do
$CLANG_FORMAT -output-replacements-xml $i | grep -c "<replacement " > /dev/null
Expand Down
8 changes: 5 additions & 3 deletions samples/greengrass/basic_discovery/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,12 @@ int main(int argc, char *argv[])
}
else
{
fprintf(stderr, "Discover failed with error: %s, and http response code %d\n",
aws_error_debug_str(error), httpResponseCode);
fprintf(
stderr,
"Discover failed with error: %s, and http response code %d\n",
aws_error_debug_str(error),
httpResponseCode);
exit(-1);

}
});

Expand Down
6 changes: 3 additions & 3 deletions samples/jobs/describe_job_execution/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ int main(int argc, char *argv[])
}

auto clientConfig = Aws::Iot::MqttClientConnectionConfigBuilder(certificatePath.c_str(), keyPath.c_str())
.WithEndpoint(endpoint)
.WithCertificateAuthority(caFile.c_str())
.Build();
.WithEndpoint(endpoint)
.WithCertificateAuthority(caFile.c_str())
.Build();

if (!clientConfig)
{
Expand Down
6 changes: 3 additions & 3 deletions samples/shadow/shadow_sync/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ int main(int argc, char *argv[])
}

auto clientConfig = Aws::Iot::MqttClientConnectionConfigBuilder(certificatePath.c_str(), keyPath.c_str())
.WithEndpoint(endpoint)
.WithCertificateAuthority(caFile.c_str())
.Build();
.WithEndpoint(endpoint)
.WithCertificateAuthority(caFile.c_str())
.Build();

if (!clientConfig)
{
Expand Down