|
| 1 | +name: log4cxx |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - '*' |
| 7 | + path: |
| 8 | + - 'instrumentation/log4cxx/**' |
| 9 | + - '.github/workflows/log4cxx.yml' |
| 10 | + pull_request: |
| 11 | + branches: [main] |
| 12 | + paths: |
| 13 | + - 'instrumentation/log4cxx/**' |
| 14 | + - '.github/workflows/log4cxx.yml' |
| 15 | + |
| 16 | +jobs: |
| 17 | + cmake_linux: |
| 18 | + name: CMake Linux |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - name: checkout googletest |
| 22 | + uses: actions/checkout@v3 |
| 23 | + with: |
| 24 | + repository: "google/googletest" |
| 25 | + ref: "release-1.12.1" |
| 26 | + path: "googletest" |
| 27 | + - name: checkout logging-log4cxx |
| 28 | + uses: actions/checkout@v3 |
| 29 | + with: |
| 30 | + repository: "apache/logging-log4cxx" |
| 31 | + ref: "rel/v1.2.0" |
| 32 | + path: "logging-log4cxx" |
| 33 | + - name: checkout opentelemetry-cpp-contrib |
| 34 | + uses: actions/checkout@v3 |
| 35 | + with: |
| 36 | + path: opentelemetry-cpp-contrib |
| 37 | + - name: checkout opentelemetry-cpp |
| 38 | + uses: actions/checkout@v3 |
| 39 | + with: |
| 40 | + repository: "open-telemetry/opentelemetry-cpp" |
| 41 | + ref: "v1.14.2" |
| 42 | + path: "opentelemetry-cpp" |
| 43 | + submodules: "recursive" |
| 44 | + - name: setup dependencies |
| 45 | + run: | |
| 46 | + sudo apt update -y |
| 47 | + sudo apt install -y --no-install-recommends --no-install-suggests \ |
| 48 | + build-essential \ |
| 49 | + cmake \ |
| 50 | + ninja-build \ |
| 51 | + libssl-dev \ |
| 52 | + libcurl4-openssl-dev \ |
| 53 | + libprotobuf-dev \ |
| 54 | + protobuf-compiler \ |
| 55 | + libgmock-dev \ |
| 56 | + libgtest-dev \ |
| 57 | + libbenchmark-dev \ |
| 58 | + liblog4cxx-dev |
| 59 | +
|
| 60 | + # This is needed because libgmock-dev libgtest-dev installs 1.11, |
| 61 | + # and v1.12 is required |
| 62 | + - name: build googletest 1.12 |
| 63 | + run: | |
| 64 | + mkdir -p "${GITHUB_WORKSPACE}/googletest/build" |
| 65 | + cd "${GITHUB_WORKSPACE}/googletest/build" |
| 66 | + cmake .. -G Ninja |
| 67 | + cmake --build . -j$(nproc) |
| 68 | + cmake --install . --prefix="${GITHUB_WORKSPACE}/sandbox" |
| 69 | +
|
| 70 | + # This is needed because liblog4cxx-dev installs 0.12.1-4, |
| 71 | + # and v1.0.0 is required |
| 72 | + - name: build logging-log4cxx |
| 73 | + run: | |
| 74 | + mkdir -p "${GITHUB_WORKSPACE}/logging-log4cxx/build" |
| 75 | + cd "${GITHUB_WORKSPACE}/logging-log4cxx/build" |
| 76 | + cmake .. -G Ninja |
| 77 | + cmake --build . -j$(nproc) |
| 78 | + cmake --install . --prefix="${GITHUB_WORKSPACE}/sandbox" |
| 79 | +
|
| 80 | + - name: build opentelemetry-cpp |
| 81 | + run: | |
| 82 | + mkdir -p "${GITHUB_WORKSPACE}/opentelemetry-cpp/build" |
| 83 | + cd "${GITHUB_WORKSPACE}/opentelemetry-cpp/build" |
| 84 | + cmake .. -G Ninja -DBUILD_TESTING=OFF -DWITH_BENCHMARK=OFF -DOPENTELEMETRY_INSTALL=ON |
| 85 | + cmake --build . -j$(nproc) |
| 86 | + cmake --install . --prefix="${GITHUB_WORKSPACE}/sandbox" |
| 87 | +
|
| 88 | + - name: build instrumentation/log4cxx contrib |
| 89 | + run: | |
| 90 | + mkdir -p "${GITHUB_WORKSPACE}/instrumentation-log4cxx/build" |
| 91 | + cd "${GITHUB_WORKSPACE}/instrumentation-log4cxx/build" |
| 92 | + cmake ../../opentelemetry-cpp-contrib/instrumentation/log4cxx \ |
| 93 | + -G Ninja \ |
| 94 | + -DCMAKE_PREFIX_PATH="${GITHUB_WORKSPACE}/sandbox" \ |
| 95 | + -DBUILD_TESTING=ON \ |
| 96 | + -DWITH_EXAMPLES=ON \ |
| 97 | + -DOPENTELEMETRY_INSTALL=ON |
| 98 | + cmake --build . -j$(nproc) |
| 99 | + ctest -j1 --output-on-failure |
| 100 | + cmake --install . --prefix="${GITHUB_WORKSPACE}/sandbox" |
| 101 | +
|
0 commit comments