-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add .circleci/config.yml * Fix machine setup * Set up CI build workflow * Fix project directory * Fix project directory, take 2 * Fix project directory, take 3 * Set up clang test, extract shared bits * YAML fun time * YAML fun time continued * Add arm, fix static tests * Add arm, take 2 * Set Up Bazel test * Try osx runner * Test dir state between run commands * OSX setup with Homebrew * Try codecov orb * Try codecov orb, take 2 * Codecov runner, take 2
- Loading branch information
Showing
2 changed files
with
110 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
version: 2.1 | ||
|
||
linux-setup: &linux-setup > | ||
sudo apt-get update && | ||
sudo apt-get install -y gcc clang g++ cmake clang-format-8 cppcheck valgrind && | ||
sudo apt install libcmocka-dev | ||
|
||
build-test: &build-test > | ||
cmake -DWITH_TESTS=ON \ | ||
-DCBOR_CUSTOM_ALLOC=ON \ | ||
-DCMAKE_BUILD_TYPE=Debug \ | ||
-DSANITIZE=OFF \ | ||
. && | ||
make VERBOSE=1 && | ||
ctest -VV | ||
|
||
orbs: | ||
codecov: codecov/codecov@3.2.2 | ||
jobs: | ||
static-test: | ||
machine: | ||
image: ubuntu-2004:202010-01 | ||
steps: | ||
- checkout | ||
- run: *linux-setup | ||
- run: cppcheck . --error-exitcode=1 | ||
- run: bash clang-format.sh --verbose && git diff-index --quiet HEAD | ||
|
||
build-and-test: | ||
machine: | ||
image: ubuntu-2004:202010-01 | ||
steps: | ||
- checkout | ||
- run: *linux-setup | ||
- run: > | ||
cmake -DWITH_TESTS=ON \ | ||
-DCBOR_CUSTOM_ALLOC=ON \ | ||
-DCMAKE_BUILD_TYPE=Debug \ | ||
-DSANITIZE=OFF \ | ||
-DCOVERAGE=ON \ | ||
. | ||
- run: make VERBOSE=1 | ||
- run: ctest -VV | ||
- run: ctest -T Coverage | ||
- codecov/upload | ||
# TODO: Reenable, currently fails on libjson leak (package out of date) | ||
# The issue actually seems to be in the instrumentation code, not | ||
# libcbor (we don't use libjsoncpp) | ||
# https://github.com/open-source-parsers/jsoncpp/issues/507 | ||
# - run: > | ||
# ctest --output-on-failure -T memcheck | tee memcheck.out | ||
# if grep -q 'Memory Leak\|IPW\|Uninitialized Memory Conditional\|Uninitialized Memory Read' memcheck.out; then | ||
# exit 1 | ||
# fi; | ||
|
||
build-and-test-clang: | ||
machine: | ||
image: ubuntu-2004:202010-01 | ||
steps: | ||
- checkout | ||
- run: *linux-setup | ||
- run: > | ||
export CC=/usr/bin/clang | ||
export CXX=/usr/bin/clang++ | ||
- run: *build-test | ||
|
||
build-and-test-arm: | ||
machine: | ||
image: ubuntu-2004:202101-01 | ||
resource_class: arm.medium | ||
steps: | ||
- checkout | ||
- run: *linux-setup | ||
- run: *build-test | ||
|
||
build-bazel: | ||
machine: | ||
image: ubuntu-2004:202101-01 | ||
steps: | ||
- checkout | ||
- run: *linux-setup | ||
- run: sudo apt install apt-transport-https curl gnupg | ||
- run: curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg | ||
- run: sudo mv bazel.gpg /etc/apt/trusted.gpg.d/ | ||
- run: echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list | ||
- run: sudo apt update && sudo apt install bazel | ||
- run: bazel --version | ||
- run: > | ||
pushd examples/bazel && | ||
bazel run -s src:hello | ||
build-and-test-osx: | ||
macos: | ||
xcode: 12.5.1 | ||
steps: | ||
- checkout | ||
- run: bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | ||
- run: brew install cmocka cmake | ||
- run: *build-test | ||
|
||
workflows: | ||
build-and-test: | ||
jobs: | ||
- static-test | ||
- build-and-test | ||
- build-and-test-clang | ||
- build-and-test-arm | ||
- build-and-test-osx | ||
- build-bazel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters