From 965da4ffb571c3a1d4eefc7179d10753a902022d Mon Sep 17 00:00:00 2001 From: alph00 Date: Fri, 28 Jun 2024 03:42:43 +0000 Subject: [PATCH] try --- .github/workflows/build-core-spl-ut.yaml | 90 +++++++++++++++++++ ...-ut.yaml => build-core-withoutspl-ut.yaml} | 23 ++--- core/CMakeLists.txt | 1 + core/unittest/CMakeLists.txt | 58 ++++++------ 4 files changed, 134 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/build-core-spl-ut.yaml rename .github/workflows/{build-core-ut.yaml => build-core-withoutspl-ut.yaml} (88%) diff --git a/.github/workflows/build-core-spl-ut.yaml b/.github/workflows/build-core-spl-ut.yaml new file mode 100644 index 0000000000..7a0226479b --- /dev/null +++ b/.github/workflows/build-core-spl-ut.yaml @@ -0,0 +1,90 @@ +# Copyright 2024 iLogtail Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Build Core SPL Unit Test + +on: + pull_request: + paths-ignore: + - "docs/**" + - "example_config/**" + - "docker/**" + - "k8s_template/**" + - "changes/**" + - "licenses/**" + - "CHANGELOG.md" + push: + branches: + - main + - 1.* + +jobs: + CI: + runs-on: ${{ matrix.runner }} + timeout-minutes: 90 + strategy: + matrix: + go-version: [1.19] + # https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idruns-on + runner: [arc-runner-set-ilogtail] + fail-fast: true + steps: + - name: prepare ubuntu environment + run: sudo apt-get clean && sudo apt-get update && sudo apt-get install -y libsystemd-dev build-essential git curl bc + # Clean up space to prevent action from running out of disk space. + - name: Free disk space + run: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf /opt/ghc + sudo rm -rf "/usr/local/share/boost" + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + sudo -E apt-get -qq autoremove --purge + sudo -E apt-get -qq clean + + - name: Check disk space + run: | + df -hT $PWD + + - name: Set up Go ${{ matrix.go-version }} + uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + + - name: Check out code + uses: actions/checkout@v4 + with: + submodules: true + + - name: Build SPL Unit Test + env: + BUILD_LOGTAIL: OFF + BUILD_LOGTAIL_UT: ON + ENABLE_COMPATIBLE_MODE: ON + ENABLE_STATIC_LINK_CRT: ON + WITHOUTGDB: ON + ONLY_SPL_UT: ON + MAKE_JOBS: 8 + # BUILD_TYPE: Debug # TODO: Uncomment when memory management is refined + run: make core + + - name: SPL Unit Test + run: make unittest_core + + result: + runs-on: arc-runner-set-ilogtail + timeout-minutes: 90 + needs: [CI] + steps: + - name: Build Result + run: echo "Just to make the GitHub merge button green" diff --git a/.github/workflows/build-core-ut.yaml b/.github/workflows/build-core-withoutspl-ut.yaml similarity index 88% rename from .github/workflows/build-core-ut.yaml rename to .github/workflows/build-core-withoutspl-ut.yaml index a1df4597ae..4d45b57d39 100644 --- a/.github/workflows/build-core-ut.yaml +++ b/.github/workflows/build-core-withoutspl-ut.yaml @@ -12,18 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: Build Core Unit Test +name: Build Core Unit Test Without SPL on: pull_request: paths-ignore: - - 'docs/**' - - 'example_config/**' - - 'docker/**' - - 'k8s_template/**' - - 'changes/**' - - 'licenses/**' - - 'CHANGELOG.md' + - "docs/**" + - "example_config/**" + - "docker/**" + - "k8s_template/**" + - "changes/**" + - "licenses/**" + - "CHANGELOG.md" push: branches: - main @@ -51,7 +51,7 @@ jobs: sudo rm -rf "$AGENT_TOOLSDIRECTORY" sudo -E apt-get -qq autoremove --purge sudo -E apt-get -qq clean - + - name: Check disk space run: | df -hT $PWD @@ -66,18 +66,19 @@ jobs: with: submodules: true - - name: Build Unit Test + - name: Build Unit Test Without SPL env: BUILD_LOGTAIL: OFF BUILD_LOGTAIL_UT: ON ENABLE_COMPATIBLE_MODE: ON ENABLE_STATIC_LINK_CRT: ON WITHOUTGDB: ON + WITHOUTSPL: ON MAKE_JOBS: 8 # BUILD_TYPE: Debug # TODO: Uncomment when memory management is refined run: make core - - name: Unit Test + - name: Unit Test Without SPL run: make unittest_core result: diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 1674cf4aee..5c2c192d8a 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -32,6 +32,7 @@ cmake_dependent_option(ENABLE_STATIC_LINK_CRT "Build Logtail by linking CRT stat option(WITHOUTGDB "Build Logtail without gdb") option(WITHOUTSPL "Build Logtail and UT without SPL") option(BUILD_LOGTAIL_UT "Build unit test for Logtail") +option(ONLY_SPL_UT "Only build UT with SPL") if (ENABLE_ENTERPRISE) message(STATUS "Enable Enterprise Feature.") diff --git a/core/unittest/CMakeLists.txt b/core/unittest/CMakeLists.txt index 2d61bba135..514e216868 100644 --- a/core/unittest/CMakeLists.txt +++ b/core/unittest/CMakeLists.txt @@ -37,36 +37,40 @@ endif() link_all(${PROJECT_NAME}) -add_subdirectory(app_config) -add_subdirectory(batch) -add_subdirectory(checkpoint) -add_subdirectory(common) -add_subdirectory(compression) -add_subdirectory(config) -add_subdirectory(config_sdk) -add_subdirectory(container_manager) -add_subdirectory(controller) -add_subdirectory(event) -add_subdirectory(event_handler) -add_subdirectory(file_source) -add_subdirectory(flusher) -add_subdirectory(input) -add_subdirectory(log_pb) -add_subdirectory(models) -add_subdirectory(monitor) -add_subdirectory(pipeline) -add_subdirectory(plugin) -add_subdirectory(polling) -add_subdirectory(processor) -add_subdirectory(queue) -add_subdirectory(reader) -add_subdirectory(sdk) -add_subdirectory(sender) -add_subdirectory(serializer) +if(NOT ONLY_SPL_UT) + add_subdirectory(app_config) + add_subdirectory(batch) + add_subdirectory(checkpoint) + add_subdirectory(common) + add_subdirectory(compression) + add_subdirectory(config) + add_subdirectory(config_sdk) + add_subdirectory(container_manager) + add_subdirectory(controller) + add_subdirectory(event) + add_subdirectory(event_handler) + add_subdirectory(file_source) + add_subdirectory(flusher) + add_subdirectory(input) + add_subdirectory(log_pb) + add_subdirectory(models) + add_subdirectory(monitor) + add_subdirectory(pipeline) + add_subdirectory(plugin) + add_subdirectory(polling) + add_subdirectory(processor) + add_subdirectory(queue) + add_subdirectory(reader) + add_subdirectory(sdk) + add_subdirectory(sender) + add_subdirectory(serializer) +endif() if (LINUX) if (NOT WITHOUTSPL) add_subdirectory(spl) endif () - add_subdirectory(observer) + if (NOT ONLY_SPL_UT) + add_subdirectory(observer) + endif() endif () \ No newline at end of file