Skip to content

Commit

Permalink
Merge branch 'master' into network
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Tax authored Jul 6, 2020
2 parents 3733f22 + 7486a29 commit d21c987
Show file tree
Hide file tree
Showing 79 changed files with 1,768 additions and 239 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.0
3.3.0
28 changes: 28 additions & 0 deletions .github/.codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
codecov:
require_ci_to_pass: yes
max_report_age: off

coverage:
precision: 2
round: down
range: "80...100"

parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no

comment:
layout: "reach,diff,flags,tree"
behavior: default
require_changes: no

# Relative file path fixing.
# CI file paths must match Git file paths.
# This fix removes the "/home/runner/" prefix
# to coverage report file paths.
fixes:
- "/home/runner/::"
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# This file controls who is tagged for review for any given pull request.

# For anything not explicitly taken by someone else:
* @g-easy @jmacd @maxgolov @reyang @rnburn @tigrannajaryan
* @open-telemetry/cpp-approvers
200 changes: 200 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
cmake_test:
name: CMake test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: setup
run: |
sudo ./ci/setup_cmake.sh
sudo ./ci/setup_ci_environment.sh
- name: run tests
run: ./ci/do_ci.sh cmake.test

cmake_test_cxx20:
name: CMake C++20 test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: setup
run: |
sudo ./ci/setup_ci_environment.sh
sudo ./ci/setup_cmake.sh
- name: run tests
run: ./ci/do_ci.sh cmake.c++20.test

plugin_test:
name: Plugin -> CMake
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: setup
run: |
sudo ./ci/setup_cmake.sh
sudo ./ci/setup_ci_environment.sh
- name: run tests
run: ./ci/do_ci.sh cmake.test_example_plugin

gcc_48_test:
name: Legacy Bazel
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: setup
run: |
sudo ./ci/setup_ci_environment.sh
sudo ./ci/install_bazelisk.sh
sudo ./ci/install_gcc48.sh
- name: run tests
run: ./ci/do_ci.sh bazel.legacy.test

bazel_test:
name: Bazel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: setup
run: |
sudo ./ci/setup_cmake.sh
sudo ./ci/setup_ci_environment.sh
sudo ./ci/install_bazelisk.sh
- name: run tests
run: ./ci/do_ci.sh bazel.test

bazel_noexcept:
name: Bazel noexcept
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: setup
run: |
sudo ./ci/setup_cmake.sh
sudo ./ci/setup_ci_environment.sh
sudo ./ci/install_bazelisk.sh
- name: run tests
run: ./ci/do_ci.sh bazel.noexcept

bazel_asan:
name: Bazel asan config
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: setup
run: |
sudo ./ci/setup_cmake.sh
sudo ./ci/setup_ci_environment.sh
sudo ./ci/install_bazelisk.sh
- name: run tests
run: ./ci/do_ci.sh bazel.asan

bazel_tsan:
name: Bazel tsan config
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: setup
run: |
sudo ./ci/setup_cmake.sh
sudo ./ci/setup_ci_environment.sh
sudo ./ci/install_bazelisk.sh
- name: run tests
run: ./ci/do_ci.sh bazel.tsan

benchmark:
name: Benchmark
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: setup
run: |
sudo ./ci/setup_cmake.sh
sudo ./ci/setup_ci_environment.sh
sudo ./ci/install_bazelisk.sh
- name: run tests
run: |
env BENCHMARK_DIR=/benchmark
./ci/do_ci.sh benchmark
- name: Upload benchmark results
uses: actions/upload-artifact@v2
with:
name: benchmark_reports
path: /home/runner/benchmark

format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: setup
run: sudo ./ci/install_format_tools.sh
- name: run tests
run: ./ci/do_ci.sh format

osx_test:
name: Bazel on MacOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: run tests
run: ./ci/do_ci.sh bazel.test

windows:
name: CMake -> exporter proto
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: setup
run: |
./ci/setup_windows_cmake.ps1
./ci/setup_windows_ci_environment.ps1
./ci/install_windows_protobuf.ps1
- name: run cmake test
run: ./ci/do_ci.ps1 cmake.test
- name: run otprotocol test
run: ./ci/do_ci.ps1 cmake.exporter.otprotocol.test

windows_bazel:
name: Bazel Windows
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: setup
run: ./ci/install_windows_bazelisk.ps1
- name: run tests
run: ./ci/do_ci.ps1 bazel.build

windows_plugin_test:
name: Plugin -> CMake Windows
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: setup
run: |
./ci/setup_windows_cmake.ps1
./ci/setup_windows_ci_environment.ps1
- name: run tests
run: ./ci/do_ci.ps1 cmake.test_example_plugin

code_coverage:
name: Code coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: setup
run: |
sudo ./ci/setup_cmake.sh
sudo ./ci/setup_ci_environment.sh
- name: run tests and generate report
run: ./ci/do_ci.sh code.coverage
- name: upload report
uses: codecov/codecov-action@v1
with:
file: /home/runner/build/coverage.info
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ cmake_policy(SET CMP0057 NEW)

project(opentelemetry-cpp)

set(CMAKE_CXX_STANDARD 11)
if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)
endif()

option(WITH_SDK "Whether to build the SDK or just the API" ON)
option(WITH_OTPROTOCOL
Expand All @@ -24,6 +26,13 @@ include(CTest)

find_package(Threads)

if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# Options for Visual C++ compiler: /Zc:__cplusplus - report an updated value
# for recent C++ language standards. Without this option MSVC returns the
# value of __cplusplus="199711L"
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus")
endif()

if(WITH_SDK AND WITH_PROTOBUF)
set(protobuf_MODULE_COMPATIBLE ON)
find_package(Protobuf CONFIG NAMES protobuf)
Expand Down
Loading

0 comments on commit d21c987

Please sign in to comment.