Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
hefroy committed Nov 23, 2022
1 parent 15011a4 commit 394325f
Show file tree
Hide file tree
Showing 21 changed files with 454 additions and 152 deletions.
56 changes: 56 additions & 0 deletions .github/template/fwe-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

name: Build AWS IoT FleetWise Edge

inputs:
build-arch:
required: true
upload-arch:
required: true

runs:
using: "composite"
steps:
- name: cache-deps
id: cache-deps
uses: actions/cache@v3
with:
path: deps-${{ inputs.build-arch }}
key: deps-${{ inputs.build-arch }}

- name: install-deps
shell: bash
run: |
sudo ./tools/install-deps-${{ inputs.build-arch }}.sh
sudo chown -R $(id -u):$(id -g) deps-${{ inputs.build-arch }}
- name: build
shell: bash
run: ./tools/build-fwe-${{ inputs.build-arch }}.sh

- name: unit-test
shell: bash
if: inputs.build-arch == 'native'
run: |
cd build
CTEST_OUTPUT_ON_FAILURE=1 ctest
- name: upload-artifacts
uses: actions/upload-artifact@v3
with:
name: build-${{ inputs.upload-arch }}
path: |
build/src/executionmanagement/aws-iot-fleetwise-edge
build/Testing/Temporary/
build/**/report-*.xml
- name: upload-asset
if: github.ref_type == 'tag'
shell: bash
run: |
RELEASE_VERSION="${GITHUB_REF/refs\/tags\//}"
ASSET_FILENAME="aws-iot-fleetwise-edge-${{ inputs.upload-arch }}.tar.gz"
./tools/build-dist.sh
mv build/aws-iot-fleetwise-edge.tar.gz ${ASSET_FILENAME}
gh release upload ${RELEASE_VERSION} ${ASSET_FILENAME}
94 changes: 65 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,77 @@ name: CI
on:
push:
branches: [ '*' ]
tags: [ 'v*.*.*' ]
pull_request:
branches: [ '*' ]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-test:
build-amd64:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2

- name: cache-deps
id: cache-deps
uses: actions/cache@v2
with:
path: deps-native
key: ${{ runner.os }}-deps

- name: install-deps
run: sudo ./tools/install-deps-native.sh
- uses: actions/checkout@v3
- uses: "./.github/template/fwe-build"
with:
build-arch: "native"
upload-arch: "amd64"

- name: build
run: |
mkdir -p build && cd build
cmake ..
make -j`nproc`
build-arm64:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v3
- uses: "./.github/template/fwe-build"
with:
build-arch: "cross-arm64"
upload-arch: "arm64"

- name: unit-test
run: |
cd build
CTEST_OUTPUT_ON_FAILURE=1 ctest
build-armhf:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v3
- uses: "./.github/template/fwe-build"
with:
build-arch: "cross-armhf"
upload-arch: "armhf"

- name: upload-artifacts
uses: actions/upload-artifact@v2
if: always()
with:
name: logs
path: |
build/Testing/Temporary/
build/**/report-*.xml
build-docker:
runs-on: ubuntu-18.04
needs:
- build-amd64
- build-arm64
- build-armhf
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- name: Move artifacts to match buildx TARGETPLATFORM structure
run: |
mkdir -p linux/arm
mv build-amd64 linux/amd64
mv build-arm64 linux/arm64
mv build-armhf linux/arm/v7
find linux -name aws-iot-fleetwise-edge -exec chmod +x {} \;
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ env.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- uses: docker/build-push-action@v3
with:
context: .
file: "./tools/container/Dockerfile"
push: ${{ github.ref_type == 'tag' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
cache-from: type=gha
cache-to: type=gha,mode=max
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ option(FWE_FEATURE_CAMERA "Enable Camera Data Collection feature" OFF)
option(FWE_TEST_CLANG_TIDY "Add clang-tidy test" ON)
option(FWE_TEST_CLANG_FORMAT "Add clang-format test" ON)
option(FWE_SECURITY_COMPILE_FLAGS "Add security related compile options" OFF)
option(FWE_IOT_SDK_SHARED_LIBS "Use AWS IoT Device SDK shared libs" OFF)
option(FWE_AWS_SDK_SHARED_LIBS "Use AWS SDK shared libs. Needs to be set to the same value of BUILD_SHARED_LIBS that the SDK was compiled with." OFF)
option(FWE_AWS_SDK_EXTRA_LIBS "Extra libs required to link with the AWS SDK. When FWE_STATIC_LINK is ON, setting this to ON will automatically find the standard libs. Can be a space-separated list of libs." ON)
option(FWE_EXAMPLE_IWAVEGPS "Include the IWave GPS example for a custom data source" OFF)
if(FWE_EXAMPLE_IWAVEGPS)
add_compile_options("-DFWE_EXAMPLE_IWAVEGPS")
Expand Down
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,23 @@ See [SECURITY](./SECURITY.md) for more information
Edge Agent Reference Implementation for AWS IoT FleetWise depends on the following open source libraries. Refer to the corresponding links for more information.

* [AWS SDK for C++: v1.9.253](https://github.com/aws/aws-sdk-cpp)
* [cURL: v7.58.0](https://github.com/curl/curl)
* [GoogleTest version: release-1.10.0](https://github.com/google/googletest)
* [Benchmark version: 1.6.1](https://github.com/google/benchmark)
* [Protobuf version: 3.21.7](https://github.com/protocolbuffers/protobuf)
* [Boost version 1.65.1](https://github.com/boostorg/boost)
* [jsoncpp version 1.7.4](https://github.com/open-source-parsers/jsoncpp)
* [Snappy version: 1.1.7](https://github.com/google/snappy)
* [Curl: v7.58.0](https://github.com/curl/curl)
* [OpenSSL: v1.1.1](https://github.com/openssl/openssl)
* [zlib: v1.2.11](https://github.com/madler/zlib)
* [GoogleTest: v1.10.0](https://github.com/google/googletest)
* [Google Benchmark: v1.6.1](https://github.com/google/benchmark)
* [Protobuf: v3.21.7](https://github.com/protocolbuffers/protobuf)
* [Boost: v1.65.1](https://github.com/boostorg/boost)
* [JsonCpp: v1.7.4](https://github.com/open-source-parsers/jsoncpp)
* [Snappy: v1.1.7](https://github.com/google/snappy)

Optional: The following dependencies are only required when the experimental option `FWE_FEATURE_CAMERA` is enabled.

* [Fast-DDS version: 2.3.3](https://github.com/eProsima/Fast-DDS.git)
* [Fast-CDR version: v1.0.21](https://github.com/eProsima/Fast-CDR.git)
* [Foonathan memory vendor version: v1.1.0](https://github.com/eProsima/foonathan_memory_vendor.git)
* [Foonathan memory version: v0.7](https://github.com/foonathan/memory)
* [tinyxml2 version: 6.0.0](https://github.com/leethomason/tinyxml2.git)
* [Fast-DDS: v2.3.3](https://github.com/eProsima/Fast-DDS)
* [Fast-CDR: v1.0.21](https://github.com/eProsima/Fast-CDR)
* [Foonathan Memory Vendor: v1.1.0](https://github.com/eProsima/foonathan_memory_vendor)
* [Foonathan Memory: v0.7](https://github.com/foonathan/memory)
* [TinyXML-2: v6.0.0](https://github.com/leethomason/tinyxml2)

See [LICENSE](./LICENSE) for more information.

Expand Down
110 changes: 75 additions & 35 deletions THIRD-PARTY-LICENSES
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
** github.com/aws/aws-sdk-cpp; version 1.9.253 --
https://github.com/aws/aws-sdk-cpp
** github.com/eProsima/Fast-DDS; version 2.3.3 --
https://github.com/eProsima/Fast-DDS
** github.com/eProsima/Fast-CDR; version 1.0.21 --
https://github.com/eProsima/Fast-CDR.git
** github.com/eProsima/foonathan_memory_vendor; version 1.1.0 --
https://github.com/eProsima/foonathan_memory_vendor

AWS IoT FleetWise Edge includes the following third-party software/licensing:

** AWS SDK for C++: v1.9.253 - https://github.com/aws/aws-sdk-cpp
** Fast-DDS: v2.3.3 - https://github.com/eProsima/Fast-DDS
** Fast-CDR: v1.0.21 - https://github.com/eProsima/Fast-CDR
** Foonathan Memory Vendor: v1.1.0 - https://github.com/eProsima/foonathan_memory_vendor
** Google Benchmark: v1.6.1 - https://github.com/google/benchmark
** OpenSSL: v1.1.1 - https://github.com/openssl/openssl

Apache License
Version 2.0, January 2004
Expand Down Expand Up @@ -212,12 +210,10 @@ https://github.com/eProsima/Fast-CDR.git
See the License for the specific language governing permissions and
limitations under the License.

------
----------------

** github.com/google/googletest; version 1.10.0 --
https://github.com/google/googletest
** https://github.com/protocolbuffers/protobuf; version 3.21.7 --
https://github.com/protocolbuffers/protobuf
** GoogleTest: v1.10.0 - https://github.com/google/googletest
** Protobuf: v3.21.7 - https://github.com/protocolbuffers/protobuf

Copyright 2008, Google Inc.
All rights reserved.
Expand Down Expand Up @@ -248,11 +244,9 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

----------------

------

** github.com/boostorg/boost; version 1.65.1 --
https://github.com/boostorg/boost
** Boost: v1.65.1 - https://github.com/boostorg/boost

Boost Software License - Version 1.0 - August 17th, 2003

Expand All @@ -278,13 +272,11 @@ FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

------

** github.com/open-source-parsers/jsoncpp; version 1.7.4 --
https://github.com/open-source-parsers/jsoncpp
----------------

** JsonCpp: v1.7.4 - https://github.com/open-source-parsers/jsoncpp

The JsonCpp library's source code, including accompanying documentation,
The JsonCpp library's source code, including accompanying documentation,
tests and demonstration applications, are licensed under the following
conditions...

Expand Down Expand Up @@ -340,11 +332,9 @@ and license text in the source code. Note also that by accepting the
Public Domain "license" you can re-license your copy using whatever
license you like.

------

** github.com/google/snappy; version 1.1.7 --
https://github.com/google/snappy
----------------

** Snappy: v1.1.7 - https://github.com/google/snappy

Copyright 2011, Google Inc.
All rights reserved.
Expand Down Expand Up @@ -402,11 +392,9 @@ Some of the benchmark data in testdata/ is licensed differently:
(http://www.gutenberg.org/ebooks/53).


------

** github.com/foonathan/memory; version 0.7 --
https://github.com/foonathan/memory
----------------

** Foonathan Memory: v0.7 - https://github.com/foonathan/memory

Copyright (C) 2015-2020 Jonathan Müller <[email protected]>

Expand All @@ -430,10 +418,9 @@ it freely, subject to the following restrictions:
3. This notice may not be removed or altered from any
source distribution.

------
----------------

** github.com/leethomason/tinyxml2; version 6.0.0 --
https://github.com/leethomason/tinyxml2
** TinyXML-2: v6.0.0 - https://github.com/leethomason/tinyxml2

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
Expand All @@ -453,4 +440,57 @@ must not be misrepresented as being the original software.

3. This notice may not be removed or altered from any source
distribution.
------

----------------

** Curl: v7.58.0 - https://github.com/curl/curl

COPYRIGHT AND PERMISSION NOTICE

Copyright (c) 1996 - 2022, Daniel Stenberg, <[email protected]>, and many
contributors, see the THANKS file.

All rights reserved.

Permission to use, copy, modify, and distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright
notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the name of a copyright holder shall not
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization of the copyright holder.

----------------

** zlib: v1.2.11 - https://github.com/madler/zlib

Copyright notice:

(C) 1995-2017 Jean-loup Gailly and Mark Adler

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

Jean-loup Gailly Mark Adler
[email protected] [email protected]
Loading

0 comments on commit 394325f

Please sign in to comment.