simdjson/.circleci/config.yml

317 lines
11 KiB
YAML
Raw Normal View History

2019-08-15 04:19:55 +08:00
version: 2.1
# We constantly run out of memory so please do not use parallelism (-j, -j4).
2019-08-15 06:47:20 +08:00
# Reusable image / compiler definitions
2019-08-15 04:19:55 +08:00
executors:
gcc8:
docker:
2020-05-01 05:13:51 +08:00
- image: conanio/gcc8
environment:
2020-05-01 05:13:51 +08:00
CXX: g++-8
CC: gcc-8
BUILD_FLAGS:
CTEST_FLAGS: --output-on-failure
2020-03-26 23:44:26 +08:00
gcc9:
docker:
2020-05-01 05:13:51 +08:00
- image: conanio/gcc9
2020-03-26 23:44:26 +08:00
environment:
2020-05-01 05:13:51 +08:00
CXX: g++-9
CC: gcc-9
BUILD_FLAGS:
CTEST_FLAGS: --output-on-failure
2020-05-01 05:13:51 +08:00
gcc10:
docker:
- image: conanio/gcc10
environment:
CXX: g++-10
CC: gcc-10
BUILD_FLAGS:
CTEST_FLAGS: --output-on-failure
clang10:
docker:
- image: conanio/clang10
environment:
CXX: clang++-10
CC: clang-10
BUILD_FLAGS:
CTEST_FLAGS: --output-on-failure
clang9:
docker:
- image: conanio/clang9
environment:
CXX: clang++-9
2020-05-01 05:13:51 +08:00
CC: clang-9
BUILD_FLAGS:
CTEST_FLAGS: --output-on-failure
2019-08-15 04:19:55 +08:00
clang6:
docker:
2020-05-01 05:13:51 +08:00
- image: conanio/clang60
environment:
CXX: clang++-6.0
2020-05-01 05:13:51 +08:00
CC: clang-6.0
BUILD_FLAGS:
CTEST_FLAGS: --output-on-failure
2020-05-01 05:13:51 +08:00
2019-08-15 06:47:20 +08:00
# Reusable test commands (and initializer for clang 6)
2019-08-15 04:19:55 +08:00
commands:
dependency_restore:
steps:
- restore_cache:
keys:
- cmake-cache-{{ checksum "dependencies/CMakeLists.txt" }}
dependency_cache:
steps:
- save_cache:
key: cmake-cache-{{ checksum "dependencies/CMakeLists.txt" }}
paths:
- dependencies/.cache
install_cmake:
2019-08-15 04:19:55 +08:00
steps:
- run: apt-get update -qq
- run: apt-get install -y cmake
cmake_prep:
steps:
2019-08-15 04:19:55 +08:00
- checkout
- run: mkdir -p build
cmake_build_cache:
steps:
- cmake_prep
- dependency_restore
- run: cmake $CMAKE_FLAGS -DCMAKE_INSTALL_PREFIX:PATH=destination -B build .
- dependency_cache # dependencies are produced in the configure step
cmake_build:
steps:
- cmake_build_cache
- run: cmake --build build
cmake_test:
steps:
- cmake_build
- run: |
2020-09-11 23:53:41 +08:00
cd build &&
tools/json2json -h &&
ctest $CTEST_FLAGS -L acceptance &&
ctest $CTEST_FLAGS -LE acceptance -LE explicitonly
cmake_assert_test:
steps:
- run: |
cd build &&
tools/json2json -h &&
ctest $CTEST_FLAGS -L assert
2019-08-15 06:47:20 +08:00
cmake_test_all:
steps:
- cmake_build
- run: |
2020-09-11 23:53:41 +08:00
cd build &&
tools/json2json -h &&
ctest $CTEST_FLAGS -DSIMDJSON_IMPLEMENTATION="haswell;westmere;fallback" -L acceptance -LE per_implementation &&
SIMDJSON_FORCE_IMPLEMENTATION=haswell ctest $CTEST_FLAGS -L per_implementation -LE explicitonly &&
SIMDJSON_FORCE_IMPLEMENTATION=westmere ctest $CTEST_FLAGS -L per_implementation -LE explicitonly &&
SIMDJSON_FORCE_IMPLEMENTATION=fallback ctest $CTEST_FLAGS -L per_implementation -LE explicitonly &&
ctest $CTEST_FLAGS -LE "acceptance|per_implementation" # Everything we haven't run yet, run now.
cmake_perftest:
steps:
- cmake_build_cache
- run: |
cmake --build build --target checkperf &&
cd build &&
2020-09-11 23:53:41 +08:00
ctest --output-on-failure -R checkperf
# we not only want cmake to build and run tests, but we want also a successful installation from which we can build, link and run programs
cmake_install_test: # this version builds, install, test and then verify from the installation
steps:
- run: cd build && make install
- run: echo -e '#include <simdjson.h>\nint main(int argc,char**argv) {simdjson::dom::parser parser;simdjson::dom::element tweets = parser.load(argv[1]); }' > tmp.cpp && c++ -Ibuild/destination/include -Lbuild/destination/lib -std=c++17 -Wl,-rpath,build/destination/lib -o linkandrun tmp.cpp -lsimdjson && ./linkandrun jsonexamples/twitter.json
cmake_installed_test_cxx20: # assuming that it was installed, this tries to build using C++20
steps:
- run: echo -e '#include <simdjson.h>\nint main(int argc,char**argv) {simdjson::dom::parser parser;simdjson::dom::element tweets = parser.load(argv[1]); }' > tmp.cpp && c++ -Ibuild/destination/include -Lbuild/destination/lib -std=c++20 -Wl,-rpath,build/destination/lib -o linkandrun tmp.cpp -lsimdjson && ./linkandrun jsonexamples/twitter.json
jobs:
2019-08-15 06:47:20 +08:00
# static
2020-06-22 02:40:38 +08:00
justlib-gcc10:
description: Build just the library, install it and do a basic test
executor: gcc10
2020-06-29 00:25:17 +08:00
environment: { CMAKE_FLAGS: -DSIMDJSON_JUST_LIBRARY=ON }
steps: [ cmake_build, cmake_install_test, cmake_installed_test_cxx20 ]
assert-gcc10:
description: Build the library with asserts on, install it and run tests
executor: gcc10
environment: { CMAKE_FLAGS: -DSIMDJSON_GOOGLE_BENCHMARKS=OFF -DCMAKE_CXX_FLAGS_RELEASE=-O3 }
steps: [ cmake_test, cmake_assert_test ]
assert-clang10:
description: Build just the library, install it and do a basic test
executor: clang10
environment: { CMAKE_FLAGS: -DSIMDJSON_GOOGLE_BENCHMARKS=OFF -DCMAKE_CXX_FLAGS_RELEASE=-O3 }
steps: [ cmake_test, cmake_assert_test ]
gcc10-perftest:
description: Build and run performance tests on GCC 10 and AVX 2 with a cmake static build, this test performance regression
executor: gcc10
environment: { CMAKE_FLAGS: -DSIMDJSON_GOOGLE_BENCHMARKS=OFF -DSIMDJSON_BUILD_STATIC=ON }
steps: [ cmake_perftest ]
gcc10:
description: Build and run tests on GCC 10 and AVX 2 with a cmake static build
executor: gcc10
environment: { CMAKE_FLAGS: -DSIMDJSON_GOOGLE_BENCHMARKS=ON -DSIMDJSON_BUILD_STATIC=ON }
steps: [ cmake_test, cmake_install_test, cmake_installed_test_cxx20 ]
clang6:
description: Build and run tests on clang 6 and AVX 2 with a cmake static build
executor: clang6
environment: { CMAKE_FLAGS: -DSIMDJSON_GOOGLE_BENCHMARKS=ON -DSIMDJSON_BUILD_STATIC=ON }
steps: [ cmake_test, cmake_install_test ]
clang10:
description: Build and run tests on clang 10 and AVX 2 with a cmake static build
executor: clang10
environment: { CMAKE_FLAGS: -DSIMDJSON_GOOGLE_BENCHMARKS=ON -DSIMDJSON_BUILD_STATIC=ON }
steps: [ cmake_test, cmake_install_test, cmake_installed_test_cxx20 ]
# libcpp
libcpp-clang10:
description: Build and run tests on clang 10 and AVX 2 with a cmake static build and libc++
executor: clang10
environment: { CMAKE_FLAGS: -DSIMDJSON_USE_LIBCPP=ON -DSIMDJSON_BUILD_STATIC=ON }
steps: [ cmake_test, cmake_install_test, cmake_installed_test_cxx20 ]
# sanitize
sanitize-gcc10:
description: Build and run tests on GCC 10 and AVX 2 with a cmake sanitize build
executor: gcc10
environment: { CMAKE_FLAGS: -DSIMDJSON_BUILD_STATIC=OFF -DSIMDJSON_SANITIZE=ON, BUILD_FLAGS: "", CTEST_FLAGS: --output-on-failure -LE explicitonly }
steps: [ cmake_test ]
sanitize-clang10:
description: Build and run tests on clang 10 and AVX 2 with a cmake sanitize build
executor: clang10
environment: { CMAKE_FLAGS: -DSIMDJSON_BUILD_STATIC=OFF -DSIMDJSON_SANITIZE=ON, CTEST_FLAGS: --output-on-failure -LE explicitonly }
steps: [ cmake_test ]
threadsanitize-gcc10:
description: Build and run tests on GCC 10 and AVX 2 with a cmake sanitize build
executor: gcc10
environment: { CMAKE_FLAGS: -DSIMDJSON_BUILD_STATIC=OFF -DSIMDJSON_SANITIZE_THREADS=ON, BUILD_FLAGS: "", CTEST_FLAGS: --output-on-failure -LE explicitonly }
steps: [ cmake_test ]
threadsanitize-clang10:
description: Build and run tests on clang 10 and AVX 2 with a cmake sanitize build
executor: clang10
environment: { CMAKE_FLAGS: -DSIMDJSON_BUILD_STATIC=OFF -DSIMDJSON_SANITIZE_THREADS=ON, CTEST_FLAGS: --output-on-failure -LE explicitonly }
steps: [ cmake_test ]
# dynamic
dynamic-gcc10:
description: Build and run tests on GCC 10 and AVX 2 with a cmake dynamic build
executor: gcc10
environment: { CMAKE_FLAGS: -DSIMDJSON_BUILD_STATIC=OFF }
2020-05-01 05:13:51 +08:00
steps: [ cmake_test, cmake_install_test ]
dynamic-clang10:
description: Build and run tests on clang 10 and AVX 2 with a cmake dynamic build
executor: clang10
environment: { CMAKE_FLAGS: -DSIMDJSON_BUILD_STATIC=OFF }
2020-05-01 05:13:51 +08:00
steps: [ cmake_test, cmake_install_test ]
# unthreaded
unthreaded-gcc10:
description: Build and run tests on GCC 10 and AVX 2 *without* threads
executor: gcc10
environment: { CMAKE_FLAGS: -DSIMDJSON_ENABLE_THREADS=OFF }
2020-05-01 05:13:51 +08:00
steps: [ cmake_test, cmake_install_test ]
unthreaded-clang10:
description: Build and run tests on Clang 10 and AVX 2 *without* threads
executor: clang10
environment: { CMAKE_FLAGS: -DSIMDJSON_ENABLE_THREADS=OFF }
2020-05-01 05:13:51 +08:00
steps: [ cmake_test, cmake_install_test ]
# noexcept
noexcept-gcc10:
description: Build and run tests on GCC 10 and AVX 2 with exceptions off
executor: gcc10
environment: { CMAKE_FLAGS: -DSIMDJSON_EXCEPTIONS=OFF }
2020-05-01 05:13:51 +08:00
steps: [ cmake_test, cmake_install_test ]
noexcept-clang10:
description: Build and run tests on Clang 10 and AVX 2 with exceptions off
executor: clang10
environment: { CMAKE_FLAGS: -DSIMDJSON_EXCEPTIONS=OFF }
2020-05-01 05:13:51 +08:00
steps: [ cmake_test, cmake_install_test ]
#
# Misc.
#
2019-08-15 06:47:20 +08:00
# make (test and checkperf)
arch-haswell-gcc10:
description: Build, run tests and check performance on GCC 10 with -march=haswell
executor: gcc10
environment: { CXXFLAGS: -march=haswell }
2020-05-01 05:13:51 +08:00
steps: [ cmake_test ]
arch-nehalem-gcc10:
description: Build, run tests and check performance on GCC 10 with -march=nehalem
executor: gcc10
environment: { CXXFLAGS: -march=nehalem }
2020-05-01 05:13:51 +08:00
steps: [ cmake_test ]
sanitize-haswell-gcc10:
description: Build and run tests on GCC 10 and AVX 2 with a cmake sanitize build
executor: gcc10
environment: { CXXFLAGS: -march=haswell, CMAKE_FLAGS: -DSIMDJSON_BUILD_STATIC=OFF -DSIMDJSON_SANITIZE=ON, BUILD_FLAGS: "", CTEST_FLAGS: --output-on-failure -LE explicitonly }
steps: [ cmake_test ]
sanitize-haswell-clang10:
description: Build and run tests on clang 10 and AVX 2 with a cmake sanitize build
executor: clang10
environment: { CXXFLAGS: -march=haswell, CMAKE_FLAGS: -DSIMDJSON_BUILD_STATIC=OFF -DSIMDJSON_SANITIZE=ON, CTEST_FLAGS: --output-on-failure -LE explicitonly }
steps: [ cmake_test ]
2019-08-15 06:47:20 +08:00
workflows:
2019-08-15 04:19:55 +08:00
version: 2.1
build_and_test:
jobs:
# full multi-implementation tests
2020-07-21 05:49:55 +08:00
#- gcc7 tested on GitHub actions
2020-06-25 03:28:28 +08:00
- gcc10 # do not delete this as it tests our performance
- clang6
#- clang10 # this gets tested a lot below
# libc++
- libcpp-clang10
# full single-implementation tests
- sanitize-gcc10
- sanitize-clang10
- threadsanitize-gcc10
- threadsanitize-clang10
- dynamic-gcc10
- dynamic-clang10
- unthreaded-gcc10
- unthreaded-clang10
# no exceptions
- noexcept-gcc10
- noexcept-clang10
# quicker make single-implementation tests
- arch-haswell-gcc10
- arch-nehalem-gcc10
2020-06-22 02:40:38 +08:00
# sanitized single-implementation tests
- sanitize-haswell-gcc10
- sanitize-haswell-clang10
2020-06-22 02:40:38 +08:00
# testing "just the library"
- justlib-gcc10
2019-08-15 04:19:55 +08:00
# testing asserts
- assert-gcc10
- assert-clang10
# TODO add windows: https://circleci.com/docs/2.0/configuration-reference/#windows