Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
alph00 committed Jun 28, 2024
1 parent 3b9e578 commit 965da4f
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 38 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/build-core-spl-ut.yaml
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
58 changes: 31 additions & 27 deletions core/unittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()

0 comments on commit 965da4f

Please # to comment.