diff --git a/.codeclimate.yml b/.codeclimate.yml new file mode 100644 index 00000000..7c43f0f9 --- /dev/null +++ b/.codeclimate.yml @@ -0,0 +1,15 @@ +version: "2" +plugins: + cppcheck: + enabled: true + config: + check: all + language: c++ + stds: + - c++11 + includes: + - src/ + - src/include/cpp-client +exclude_patterns: + - "extern/" + - "test/" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000..e16e0a4c --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,61 @@ +name: Coverage + +on: + push: + branches: + - 'master' + - 'develop' + pull_request: + types: [ready_for_review, synchronize, opened] + +jobs: + codeclimate: + runs-on: macOS-latest + + steps: + - uses: actions/checkout@v1 + - name: Set compiler to clang++ + run: COMPILER=clang++ + - name: Install Dependencies + run: brew install cmake lcov + - name: Make scripts executable + run: sudo chmod +x ./.github/workflows/test/clang_tidy.sh + - name: Setup Code Climate test-reporter + run: | + curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-darwin-amd64 > ./cc-test-reporter + chmod +x ./cc-test-reporter + - name: Build & Run Coverage Tests + run: | + ./cc-test-reporter before-build + cmake -DCMAKE_BUILD_TYPE=Coverage -DUNIT_TEST=ON . + cmake --build . + ./test/ark_cpp_client_tests + lcov --directory . --include "*/src/*" --include "*/test/*" --exclude "*/src/lib/*" --exclude "*/extern/*" --capture --output-file coverage.info --ignore-errors gcov + ./cc-test-reporter format-coverage --input-type lcov coverage.info + ./cc-test-reporter upload-coverage + env: + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + + codecov: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Install Dependencies + run: | + sudo apt-add-repository -y ppa:ubuntu-toolchain-r/test + sudo apt-get update + sudo apt-get -y install g++-7 gcc-7 lcov + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-7 + sudo update-alternatives --config gcc + - name: Create Build directory + run: mkdir build + - name: Build + run: | + cd build + cmake -DCMAKE_BUILD_TYPE=Coverage -DUNIT_TEST=ON .. + cmake --build . + - name: Run Coverage Tests + run: ./build/test/ark_cpp_client_tests + - name: Upload Coverage Report + run: bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 865127e3..1d6bf193 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,8 +3,8 @@ name: Test on: push: branches: - - "*" - - "*/*" + - 'master' + - 'develop' pull_request: types: [ready_for_review, synchronize, opened] @@ -44,16 +44,14 @@ jobs: run: | sudo apt-add-repository -y ppa:ubuntu-toolchain-r/test sudo apt-get update - sudo apt-get -y install g++-7 lcov cmake openssl + sudo apt-get -y install g++-7 cmake openssl - name: Build run: | mkdir build && cd build - cmake -DCMAKE_BUILD_TYPE=Coverage -DUNIT_TEST=ON .. + cmake -DUNIT_TEST=ON .. cmake --build . - name: Run Tests run: ./build/test/ark_cpp_client_tests - - name: Codecov upload - run: bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }} linux-clang-5: runs-on: ubuntu-latest diff --git a/.github/workflows/test/install_platform_io.sh b/.github/workflows/test/install_platform_io.sh new file mode 100644 index 00000000..4d7860a5 --- /dev/null +++ b/.github/workflows/test/install_platform_io.sh @@ -0,0 +1,5 @@ +# install PlatformIO +sudo pip install -U platformio + +# update PlatformIO +platformio update diff --git a/.github/workflows/test/script_desktop.sh b/.github/workflows/test/script_desktop.sh new file mode 100644 index 00000000..e506b7fc --- /dev/null +++ b/.github/workflows/test/script_desktop.sh @@ -0,0 +1,13 @@ +# run desktop builds +cmake . -DCMAKE_BUILD_TYPE=Coverage -DBUILD_TESTING=OFF +cmake --build . + +# disable build examples until breaking changes are committed so the example can pull them in +# build examples +#cd ./examples/cmake_example +#cmake . +#cmake --build . + +# run Gtest +# cd ../../ +./test/Ark-Cpp-Client-tests diff --git a/.github/workflows/test/script_platform_io.sh b/.github/workflows/test/script_platform_io.sh new file mode 100644 index 00000000..7b558de4 --- /dev/null +++ b/.github/workflows/test/script_platform_io.sh @@ -0,0 +1,5 @@ +# run PlatformIO builds +platformio run + +# run PlatformIO unit tests +platformio run -d ./test diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bd0279d..68a139f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [1.3.0] - 2019-10-09 + +## [1.3.0-arduino] - 2019-10-09 ### Added - added Blockchain API endpoint ([#104]) @@ -61,7 +63,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. [#77]: https://github.com/ArkEcosystem/cpp-client/pull/77 [#78]: https://github.com/ArkEcosystem/cpp-client/pull/78 [1.2.0]: https://github.com/ArkEcosystem/cpp-client/compare/1.1.0...1.2.0 -[1.2.0-arduino]: https://github.com/ArkEcosystem/cpp-client/compare/1.1.0...1.2.0-arduino +[1.2.0-arduino]: https://github.com/ArkEcosystem/cpp-client/compare/1.1.0-arduino...1.2.0-arduino [#85]: https://github.com/ArkEcosystem/cpp-client/pull/85 [#86]: https://github.com/ArkEcosystem/cpp-client/pull/86 [#87]: https://github.com/ArkEcosystem/cpp-client/pull/87 @@ -71,4 +73,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. [#104]: https://github.com/ArkEcosystem/cpp-client/pull/104 [#114]: https://github.com/ArkEcosystem/cpp-client/pull/114 [#140]: https://github.com/ArkEcosystem/cpp-client/pull/140 -[unreleased]: https://github.com/ArkEcosystem/cpp-client/compare/1.2.0...develop +[1.3.0-arduino]: https://github.com/ArkEcosystem/cpp-client/compare/1.2.0-arduino...1.3.0-arduino +[1.3.0]: https://github.com/ArkEcosystem/cpp-client/compare/1.2.0...1.3.0 diff --git a/CMakeLists.txt b/CMakeLists.txt index dc18b910..ca061e05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,16 @@ endif() # ------------------------------------------------------------------------------ +# ------------------------------------------------------------------------------ +# Coverage 1:2 +# ------------------------------------------------------------------------------ + +if (CMAKE_BUILD_TYPE STREQUAL "Coverage") + add_definitions(-Wno-unused-command-line-argument) +endif() #CMAKE_BUILD_TYPE STREQUAL "Coverage" + +# ------------------------------------------------------------------------------ + # ------------------------------------------------------------------------------ # Clang Tidy # ------------------------------------------------------------------------------ diff --git a/CODEOWNERS b/CODEOWNERS index 3c0b9182..05b2aa6e 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1 +1 @@ -* @faustbrian @kristjank @supaiku0 +* @faustbrian @kristjank @supaiku0 @sleepdefic1t diff --git a/README.md b/README.md index abd24b85..a3fd940b 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,10 @@ > A simple C++ API client for the Ark Blockchain. -[![Build Status](https://badgen.now.sh/circleci/github/ArkEcosystem/cpp-client)](https://circleci.com/gh/ArkEcosystem/cpp-client) -[![Codecov](https://badgen.now.sh/codecov/c/github/arkecosystem/cpp-client)](https://codecov.io/gh/arkecosystem/cpp-client) -[![Latest Version](https://badgen.now.sh/github/release/ArkEcosystem/cpp-client)](https://github.com/ArkEcosystem/cpp-client/releases) -[![License: MIT](https://badgen.now.sh/badge/license/MIT/green)](https://opensource.org/licenses/MIT) +[![Test Actions](https://github.com/ArkEcosystem/cpp-client/workflows/Test/badge.svg)](https://github.com/ArkEcosystem/cpp-client/actions) +[![Coverage Actions](https://github.com/ArkEcosystem/cpp-client/workflows/Coverage/badge.svg)](https://github.com/ArkEcosystem/cpp-client/actions) +[![Latest Version](https://badgen.now.sh/github/release/ArkEcosystem/cpp-client?labelColor=black)](https://github.com/ArkEcosystem/cpp-client/releases) +[![License: MIT](https://badgen.now.sh/badge/license/MIT/green?labelColor=black)](https://opensource.org/licenses/MIT) > Lead Maintainer: [Simon Downey](https://github.com/sleepdefic1t) diff --git a/library.json b/library.json index 64479b4d..6c83f652 100644 --- a/library.json +++ b/library.json @@ -7,7 +7,7 @@ "type": "git", "url": "https://github.com/ArkEcosystem/Cpp-Client.git" }, - "version": "1.2.0", + "version": "1.3.0", "authors": [ { "name": "Ark Ecosystem", diff --git a/library.properties b/library.properties index 1c342a6c..b76ba85d 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Ark-Cpp-Client -version=1.2.0 +version=1.3.0 author=Ark Ecosystem maintainer=Ark Ecosystem sentence=A simple API client implementation in C++ for the ARK Blockchain. diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index dcc7c935..0adcc8e7 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -89,7 +89,7 @@ add_test(NAME test COMMAND ${PROJECT_NAME}) # ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------ -# Coverage +# Coverage 2:2 # ------------------------------------------------------------------------------ if (CMAKE_BUILD_TYPE STREQUAL "Coverage")