]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CI: github actions: use cache for OpenTracing
authorIlya Shipitsin <chipitsine@gmail.com>
Thu, 13 Jan 2022 06:36:28 +0000 (11:36 +0500)
committerWilly Tarreau <w@1wt.eu>
Thu, 13 Jan 2022 12:37:34 +0000 (13:37 +0100)
this caches OpenTracing libs between builds, should save couple of minutes
for each build.

.github/matrix.py
.github/workflows/vtest.yml

index 34a78ace42b77130665df2e927c19d95af3ceb75..3c34eaf90e99579cafb1e00edfbe15bdd3b14db5 100755 (executable)
@@ -74,8 +74,8 @@ for CC in ["gcc", "clang"]:
             "FLAGS": [
                 "USE_ZLIB=1",
                 "USE_OT=1",
-                "OT_INC=${HOME}/opt/include",
-                "OT_LIB=${HOME}/opt/lib",
+                "OT_INC=${HOME}/opt-ot/include",
+                "OT_LIB=${HOME}/opt-ot/lib",
                 "OT_RUNPATH=1",
                 "USE_PCRE=1",
                 "USE_PCRE_JIT=1",
@@ -150,8 +150,8 @@ matrix.append(
         + [
             "USE_ZLIB=1",
             "USE_OT=1",
-            "OT_INC=${HOME}/opt/include",
-            "OT_LIB=${HOME}/opt/lib",
+            "OT_INC=${HOME}/opt-ot/include",
+            "OT_LIB=${HOME}/opt-ot/lib",
             "OT_RUNPATH=1",
             "USE_PCRE=1",
             "USE_PCRE_JIT=1",
index 421384b46bc126c03434ed4b0f9056aca9905413..d24c3fffaef171ed3ce2506ff54968f5d4c93bd4 100644 (file)
@@ -42,10 +42,18 @@ jobs:
       TMPDIR: /tmp
       # Force ASAN output into asan.log to make the output more readable.
       ASAN_OPTIONS: log_path=asan.log
+      OT_CPP_VERSION: 1.5.0
     steps:
     - uses: actions/checkout@v2
       with:
         fetch-depth: 100
+    - name: Cache OpenTracing
+      if: ${{ contains(matrix.FLAGS, 'USE_OT=1') }}
+      id: cache_ot
+      uses: actions/cache@v2
+      with:
+        path: '~/opt-ot/'
+        key: ot-${{ matrix.CC }}-${{ env.OT_CPP_VERSION }}-${{ contains(matrix.name, 'ASAN') }}
     - name: Install apt dependencies
       if: ${{ startsWith(matrix.os, 'ubuntu-') }}
       run: |
@@ -68,8 +76,22 @@ jobs:
       if: ${{ matrix.ssl && matrix.ssl != 'stock' }}
       run: env ${{ matrix.ssl }} scripts/build-ssl.sh
     - name: Install OpenTracing libs
-      if: ${{ contains(matrix.FLAGS, 'USE_OT=1') }}
-      run: scripts/build-ot.sh
+      if: ${{ contains(matrix.FLAGS, 'USE_OT=1') && steps.cache_ot.outputs.cache-hit != 'true'  }}
+      run: |
+        wget https://github.com/opentracing/opentracing-cpp/archive/v${OT_CPP_VERSION}.tar.gz
+        tar xf v${OT_CPP_VERSION}.tar.gz
+        cd opentracing-cpp-${OT_CPP_VERSION}
+        mkdir build
+        cd build
+        cmake -DCMAKE_INSTALL_PREFIX=${HOME}/opt-ot -DBUILD_STATIC_LIBS=OFF -DBUILD_MOCKTRACER=OFF -DBUILD_TESTING=OFF ..
+        make -j$(nproc)
+        make install
+        git clone https://github.com/haproxytech/opentracing-c-wrapper.git
+        cd opentracing-c-wrapper
+        ./scripts/bootstrap
+        ./configure --prefix=${HOME}/opt-ot --with-opentracing=${HOME}/opt-ot
+        make -j$(nproc)
+        make install
     - name: Build WURFL
       if: ${{ contains(matrix.FLAGS, 'USE_WURFL=1') }}
       run: make -C addons/wurfl/dummy