From a6d55daa73ea8169e0a3b56de84143e438b5eae7 Mon Sep 17 00:00:00 2001 From: Leonardo Parente <23251360+leoparente@users.noreply.github.com> Date: Wed, 15 Jan 2025 21:11:23 -0300 Subject: [PATCH] new test --- .github/actions/build-cpp/entrypoint.sh | 4 +-- .github/workflows/build-develop.yml | 43 ++++++++++++++++++------ .github/workflows/build_debug.yml | 44 ++++++++++++++++++------- 3 files changed, 68 insertions(+), 23 deletions(-) diff --git a/.github/actions/build-cpp/entrypoint.sh b/.github/actions/build-cpp/entrypoint.sh index 8dfcb2653..2e0051b5a 100644 --- a/.github/actions/build-cpp/entrypoint.sh +++ b/.github/actions/build-cpp/entrypoint.sh @@ -14,14 +14,14 @@ function build() { cp -rf /github/workspace/libs/ /pktvisor-src/libs/ cp -rf /github/workspace/docker/ /pktvisor-src/docker/ cp -rf /github/workspace/golang/ /pktvisor-src/golang/ - cp -rf /github/workspace/build/ /pktvisor-src/build/ cp -rf /github/workspace/integration_tests/ /pktvisor-src/integration_tests/ cp -rf /github/workspace/cmake/ /pktvisor-src/cmake/ cp -rf /github/workspace/CMakeLists.txt /pktvisor-src/ cp -rf /github/workspace/conanfile.py /pktvisor-src/ cp -rf /github/workspace/.conanrc /pktvisor-src/ - cd /pktvisor-src/build/ + cd /pktvisor-src/ conan profile detect -f + cd /pktvisor-src/build/ PKG_CONFIG_PATH=/local/lib/pkgconfig cmake -DCMAKE_BUILD_TYPE=$INPUT_BUILD_TYPE -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake -DASAN=$INPUT_ASAN .. make all -j 4 } diff --git a/.github/workflows/build-develop.yml b/.github/workflows/build-develop.yml index 17f8d9b57..b28fa5bef 100644 --- a/.github/workflows/build-develop.yml +++ b/.github/workflows/build-develop.yml @@ -235,16 +235,39 @@ jobs: key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}- - - name: Build pktvisord + push symbol to bugsplat.com - uses: ./.github/actions/build-cpp - with: - context: "." - build_type: "Release" - asan: "OFF" - bugsplat_key: ${{secrets.BUGSPLAT_KEY}} - bugsplat_symbol_url: ${{secrets.BUGSPLAT_SYMBOL_URL}} - bugsplat: "true" - file: "./Dockerfile" + - name: Configure CMake + shell: bash + working-directory: ${{github.workspace}}/build + run: PKG_CONFIG_PATH=${{github.workspace}}/local/lib/pkgconfig cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake -DCODE_COVERAGE=ON + + - name: Get VERSION + id: build + run: echo "VERSION=`cat ${{github.workspace}}/build/VERSION`" >> $GITHUB_ENV + + - name: Build + working-directory: ${{github.workspace}}/build + shell: bash + run: cmake --build . --config Debug -- -j 4 + + - name: move files + shell: bash + run: | + cp -rf ${{github.workspace}}/build/bin/pktvisord ${{github.workspace}}/pktvisord + strip -s ${{github.workspace}}/build/bin/crashpad_handler + cp -rf ${{github.workspace}}/build/bin/crashpad_handler ${{github.workspace}}/crashpad_handler + cp -rf ${{github.workspace}}/build/bin/pktvisor-reader ${{github.workspace}}/pktvisor-reader + cp -rf ${{github.workspace}}/golang/pkg/client/version.go ${{github.workspace}}/version.go + cp -rf ${{github.workspace}}/src/tests/fixtures/pktvisor-port-service-names.csv ${{github.workspace}}/custom-iana.csv + + - name: Push symbols to bugsplat + shell: bash + run: | + wget https://github.com/orb-community/CrashpadTools/raw/main/linux/dump_syms + chmod a+x ./dump_syms + wget https://github.com/orb-community/CrashpadTools/raw/main/linux/symupload + chmod a+x ./symupload + ./dump_syms ${{github.workspace}}/pktvisord > pktvisor.sym + ./symupload -k ${{secrets.BUGSPLAT_KEY}} pktvisor.sym ${{secrets.BUGSPLAT_SYMBOL_URL}}${{env.VERSION}} 2>/dev/null - name: Build pktvisor-cli uses: ./.github/actions/build-go diff --git a/.github/workflows/build_debug.yml b/.github/workflows/build_debug.yml index 4c10ec889..7e90ad14b 100644 --- a/.github/workflows/build_debug.yml +++ b/.github/workflows/build_debug.yml @@ -82,17 +82,39 @@ jobs: key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}- - - name: Build pktvisord + push symbol to backtrace.io - uses: ./.github/actions/build-cpp - with: - context: "." - build_type: "Debug" - asan: "ON" - symbol_url: ${{secrets.SYMBOL_URL}} - bugsplat_key: ${{secrets.BUGSPLAT_KEY}} - bugsplat_symbol_url: ${{secrets.BUGSPLAT_SYMBOL_URL}} - bugsplat: "true" - file: "./Dockerfile" + - name: Configure CMake + shell: bash + working-directory: ${{github.workspace}}/build + run: PKG_CONFIG_PATH=${{github.workspace}}/local/lib/pkgconfig cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake -DCODE_COVERAGE=ON + + - name: Get VERSION + id: build + run: echo "VERSION=`cat ${{github.workspace}}/build/VERSION`" >> $GITHUB_ENV + + - name: Build + working-directory: ${{github.workspace}}/build + shell: bash + run: cmake --build . --config Debug -- -j 4 + + - name: move files + shell: bash + run: | + cp -rf ${{github.workspace}}/build/bin/pktvisord ${{github.workspace}}/pktvisord + strip -s ${{github.workspace}}/build/bin/crashpad_handler + cp -rf ${{github.workspace}}/build/bin/crashpad_handler ${{github.workspace}}/crashpad_handler + cp -rf ${{github.workspace}}/build/bin/pktvisor-reader ${{github.workspace}}/pktvisor-reader + cp -rf ${{github.workspace}}/golang/pkg/client/version.go ${{github.workspace}}/version.go + cp -rf ${{github.workspace}}/src/tests/fixtures/pktvisor-port-service-names.csv ${{github.workspace}}/custom-iana.csv + + - name: Push symbols to bugsplat + shell: bash + run: | + wget https://github.com/orb-community/CrashpadTools/raw/main/linux/dump_syms + chmod a+x ./dump_syms + wget https://github.com/orb-community/CrashpadTools/raw/main/linux/symupload + chmod a+x ./symupload + ./dump_syms ${{github.workspace}}/pktvisord > pktvisor.sym + ./symupload -k ${{secrets.BUGSPLAT_KEY}} pktvisor.sym ${{secrets.BUGSPLAT_SYMBOL_URL}}${{env.VERSION}} 2>/dev/null - name: Build pktvisor-cli uses: ./.github/actions/build-go