Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: refine CI pipeline #84

Merged
merged 24 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions .github/workflows/build_linux_ubuntu1804.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ on:
- "**.md"

jobs:
build:
concurrency: ci-${{ github.ref }}
build-linux-ubuntu1804:
concurrency:
group: build-linux-ubuntu1804-${{ github.head_ref }}-${{ matrix.build_type }}
cancel-in-progress: true
runs-on: ubuntu-22.04
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
Expand Down Expand Up @@ -69,20 +71,38 @@ jobs:
echo 'exit $status' >> cmd_wrapper.sh
shell: bash

- name: Run Tests
- name: Run Tests (ten_utils_unit_test)
env:
ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1:color=always:unmap_shadow_on_exit=1:abort_on_error=1
MALLOC_CHECK_: 3
TEN_ENABLE_MEMORY_TRACKING: "true"
TEN_ENABLE_BACKTRACE_DUMP: "true"
run: |
chmod +x cmd_wrapper.sh
chmod +x out/linux/x64/tests/standalone/ten_utils_unit_test
out/linux/x64/tests/standalone/ten_utils_unit_test
cpulimit -f -l 60 -- taskset 0x3 ./cmd_wrapper.sh out/linux/x64/tests/standalone/ten_utils_unit_test
cpulimit -f -l 30 -- taskset 0x1 ./cmd_wrapper.sh out/linux/x64/tests/standalone/ten_utils_unit_test

- name: Run Tests (ten_runtime_unit_test)
env:
ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1:color=always:unmap_shadow_on_exit=1:abort_on_error=1
MALLOC_CHECK_: 3
TEN_ENABLE_MEMORY_TRACKING: "true"
TEN_ENABLE_BACKTRACE_DUMP: "true"
run: |
chmod +x out/linux/x64/tests/standalone/ten_runtime_unit_test
out/linux/x64/tests/standalone/ten_runtime_unit_test
cpulimit -f -l 60 -- taskset 0x3 ./cmd_wrapper.sh out/linux/x64/tests/standalone/ten_runtime_unit_test
cpulimit -f -l 30 -- taskset 0x1 ./cmd_wrapper.sh out/linux/x64/tests/standalone/ten_runtime_unit_test

- name: Run Tests (ten_runtime_smoke_test)
env:
ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1:color=always:unmap_shadow_on_exit=1:abort_on_error=1
MALLOC_CHECK_: 3
TEN_ENABLE_MEMORY_TRACKING: "true"
TEN_ENABLE_BACKTRACE_DUMP: "true"
run: |
chmod +x out/linux/x64/tests/standalone/ten_runtime_smoke_test
out/linux/x64/tests/standalone/ten_runtime_smoke_test
cpulimit -f -l 60 -- taskset 0x3 ./cmd_wrapper.sh out/linux/x64/tests/standalone/ten_runtime_smoke_test
Expand Down
26 changes: 23 additions & 3 deletions .github/workflows/build_linux_ubuntu2204.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ on:
- "**.md"

jobs:
build:
concurrency: ci-${{ github.ref }}
build-linux-ubuntu2204:
concurrency:
group: build-linux-ubuntu2204-${{ github.head_ref }}-${{ matrix.compiler }}-${{ matrix.build_type }}
cancel-in-progress: true
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -69,20 +71,38 @@ jobs:
echo 'exit $status' >> cmd_wrapper.sh
shell: bash

- name: Run Tests
- name: Run Tests (ten_utils_unit_test)
env:
ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1:color=always:unmap_shadow_on_exit=1:abort_on_error=1
MALLOC_CHECK_: 3
TEN_ENABLE_MEMORY_TRACKING: "true"
TEN_ENABLE_BACKTRACE_DUMP: "true"
run: |
chmod +x cmd_wrapper.sh
chmod +x out/linux/x64/tests/standalone/ten_utils_unit_test
out/linux/x64/tests/standalone/ten_utils_unit_test
cpulimit -f -l 60 -- taskset 0x3 ./cmd_wrapper.sh out/linux/x64/tests/standalone/ten_utils_unit_test
cpulimit -f -l 30 -- taskset 0x1 ./cmd_wrapper.sh out/linux/x64/tests/standalone/ten_utils_unit_test

- name: Run Tests (ten_runtime_unit_test)
env:
ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1:color=always:unmap_shadow_on_exit=1:abort_on_error=1
MALLOC_CHECK_: 3
TEN_ENABLE_MEMORY_TRACKING: "true"
TEN_ENABLE_BACKTRACE_DUMP: "true"
run: |
chmod +x out/linux/x64/tests/standalone/ten_runtime_unit_test
out/linux/x64/tests/standalone/ten_runtime_unit_test
cpulimit -f -l 60 -- taskset 0x3 ./cmd_wrapper.sh out/linux/x64/tests/standalone/ten_runtime_unit_test
cpulimit -f -l 30 -- taskset 0x1 ./cmd_wrapper.sh out/linux/x64/tests/standalone/ten_runtime_unit_test

- name: Run Tests (ten_runtime_smoke_test)
env:
ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1:color=always:unmap_shadow_on_exit=1:abort_on_error=1
MALLOC_CHECK_: 3
TEN_ENABLE_MEMORY_TRACKING: "true"
TEN_ENABLE_BACKTRACE_DUMP: "true"
run: |
chmod +x out/linux/x64/tests/standalone/ten_runtime_smoke_test
out/linux/x64/tests/standalone/ten_runtime_smoke_test
cpulimit -f -l 60 -- taskset 0x3 ./cmd_wrapper.sh out/linux/x64/tests/standalone/ten_runtime_smoke_test
Expand Down
76 changes: 70 additions & 6 deletions .github/workflows/build_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ on:
- "**.md"

jobs:
build-arm64:
concurrency: ci-${{ github.ref }}
build-mac-arm64:
concurrency:
group: build-mac-arm64-${{ github.head_ref }}-${{ matrix.build_type }}
cancel-in-progress: true
runs-on: macos-latest
strategy:
matrix:
Expand Down Expand Up @@ -71,12 +73,44 @@ jobs:
fi
export PATH=$(pwd)/core/ten_gn:$PATH
echo $PATH
tgn gen mac arm64 ${{ matrix.build_type }} -- log_level=1 enable_serialized_actions=true ten_enable_tests=false
tgn gen mac arm64 ${{ matrix.build_type }} -- log_level=1 enable_serialized_actions=true ten_enable_integration_tests=false ten_enable_private_tests=false ten_rust_enable_tests=false
tgn build mac arm64 ${{ matrix.build_type }}
tree -I 'gen|obj' out

build-x64:
concurrency: ci-${{ github.ref }}
# - name: Run Tests (ten_utils_unit_test)
# env:
# ASAN_OPTIONS: detect_stack_use_after_return=1:color=always:unmap_shadow_on_exit=1:abort_on_error=1
# MALLOC_CHECK_: 3
# TEN_ENABLE_MEMORY_TRACKING: "true"
# TEN_ENABLE_BACKTRACE_DUMP: "true"
# run: |
# chmod +x out/mac/arm64/tests/standalone/ten_utils_unit_test
# out/mac/arm64/tests/standalone/ten_utils_unit_test

- name: Run Tests (ten_runtime_unit_test)
env:
ASAN_OPTIONS: detect_stack_use_after_return=1:color=always:unmap_shadow_on_exit=1:abort_on_error=1
MALLOC_CHECK_: 3
TEN_ENABLE_MEMORY_TRACKING: "true"
TEN_ENABLE_BACKTRACE_DUMP: "true"
run: |
chmod +x out/mac/arm64/tests/standalone/ten_runtime_unit_test
out/mac/arm64/tests/standalone/ten_runtime_unit_test

# - name: Run Tests (ten_runtime_smoke_test)
# env:
# ASAN_OPTIONS: detect_stack_use_after_return=1:color=always:unmap_shadow_on_exit=1:abort_on_error=1
# MALLOC_CHECK_: 3
# TEN_ENABLE_MEMORY_TRACKING: "true"
# TEN_ENABLE_BACKTRACE_DUMP: "true"
# run: |
# chmod +x out/mac/arm64/tests/standalone/ten_runtime_smoke_test
# out/mac/arm64/tests/standalone/ten_runtime_smoke_test

build-mac-x64:
concurrency:
group: build-mac-x64-${{ github.head_ref }}-${{ matrix.build_type }}
cancel-in-progress: true
runs-on: macos-13
strategy:
matrix:
Expand Down Expand Up @@ -123,6 +157,36 @@ jobs:
fi
export PATH=$(pwd)/core/ten_gn:$PATH
echo $PATH
tgn gen mac x64 ${{ matrix.build_type }} -- log_level=1 enable_serialized_actions=true ten_enable_tests=false
tgn gen mac x64 ${{ matrix.build_type }} -- log_level=1 enable_serialized_actions=true ten_enable_integration_tests=false ten_enable_private_tests=false ten_rust_enable_tests=false ten_package_manager_enable_tests=false
tgn build mac x64 ${{ matrix.build_type }}
tree -I 'gen|obj' out

- name: Run Tests (ten_utils_unit_test)
env:
ASAN_OPTIONS: detect_stack_use_after_return=1:color=always:unmap_shadow_on_exit=1:abort_on_error=1
MALLOC_CHECK_: 3
TEN_ENABLE_MEMORY_TRACKING: "true"
TEN_ENABLE_BACKTRACE_DUMP: "true"
run: |
chmod +x out/mac/x64/tests/standalone/ten_utils_unit_test
out/mac/x64/tests/standalone/ten_utils_unit_test

- name: Run Tests (ten_runtime_unit_test)
env:
ASAN_OPTIONS: detect_stack_use_after_return=1:color=always:unmap_shadow_on_exit=1:abort_on_error=1
MALLOC_CHECK_: 3
TEN_ENABLE_MEMORY_TRACKING: "true"
TEN_ENABLE_BACKTRACE_DUMP: "true"
run: |
chmod +x out/mac/x64/tests/standalone/ten_runtime_unit_test
out/mac/x64/tests/standalone/ten_runtime_unit_test

- name: Run Tests (ten_runtime_smoke_test)
env:
ASAN_OPTIONS: detect_stack_use_after_return=1:color=always:unmap_shadow_on_exit=1:abort_on_error=1
MALLOC_CHECK_: 3
TEN_ENABLE_MEMORY_TRACKING: "true"
TEN_ENABLE_BACKTRACE_DUMP: "true"
run: |
chmod +x out/mac/x64/tests/standalone/ten_runtime_smoke_test
out/mac/x64/tests/standalone/ten_runtime_smoke_test
32 changes: 29 additions & 3 deletions .github/workflows/build_win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ on:
- "**.md"

jobs:
build:
concurrency: ci-${{ github.ref }}
build-win-x64:
concurrency:
group: build-win-x64-${{ github.head_ref }}-${{ matrix.build_type }}
cancel-in-progress: true
runs-on: windows-latest
strategy:
matrix:
Expand Down Expand Up @@ -57,5 +59,29 @@ jobs:
- name: Build
run: |
$ENV:PATH += ";$PWD/core/ten_gn"
tgn gen win x64 ${{ matrix.build_type }} -- vs_version=2022 log_level=1 enable_serialized_actions=true ten_enable_tests=false
tgn gen win x64 ${{ matrix.build_type }} -- vs_version=2022 log_level=1 enable_serialized_actions=true ten_enable_integration_tests=false ten_enable_private_tests=false ten_rust_enable_tests=false ten_package_manager_enable_tests=false
tgn build win x64 ${{ matrix.build_type }}

- name: Run Tests (ten_utils_unit_test)
env:
TEN_ENABLE_MEMORY_TRACKING: "true"
TEN_ENABLE_BACKTRACE_DUMP: "true"
run: |
chmod +x out/win/x64/tests/standalone/ten_utils_unit_test
out/win/x64/tests/standalone/ten_utils_unit_test

# - name: Run Tests (ten_runtime_unit_test)
# env:
# TEN_ENABLE_MEMORY_TRACKING: "true"
# TEN_ENABLE_BACKTRACE_DUMP: "true"
# run: |
# chmod +x out/win/x64/tests/standalone/ten_runtime_unit_test
# out/win/x64/tests/standalone/ten_runtime_unit_test

# - name: Run Tests (ten_runtime_smoke_test)
# env:
# TEN_ENABLE_MEMORY_TRACKING: "true"
# TEN_ENABLE_BACKTRACE_DUMP: "true"
# run: |
# chmod +x out/win/x64/tests/standalone/ten_runtime_smoke_test
# out/win/x64/tests/standalone/ten_runtime_smoke_test
10 changes: 5 additions & 5 deletions tests/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ group("tests") {
}

if (ten_enable_package_manager) {
deps += [
"local_registry:copy_local_registry",
"ten_manager",
]
deps += [ "local_registry:copy_local_registry" ]

if (ten_package_manager_enable_tests) {
deps += [ "//core/src/ten_manager:tman_test" ]
deps += [
"ten_manager",
"//core/src/ten_manager:tman_test",
]
}
}
}
4 changes: 4 additions & 0 deletions tests/ten_runtime/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import("//third_party/curl/output_libs.gni")
import("//third_party/jansson/output_libs.gni")
import("//third_party/libwebsockets/output_libs.gni")
import("//third_party/mbedtls/output_libs.gni")
import("//third_party/zlib/output_libs.gni")

# Because there is no 'rpath' mechanism in Windows, we need to copy all the
# dependend libraries of 'smoke' to one folder, and setup 'PATH' before
Expand All @@ -29,6 +30,9 @@ copy("copy_libraries_for_test") {
if (ten_enable_curl) {
sources += curl_output_libs
deps += [ "//third_party/curl" ]

sources += zlib_output_libs
deps += [ "//third_party/zlib" ]
}

if (ten_enable_libwebsockets) {
Expand Down
2 changes: 1 addition & 1 deletion third_party/zlib/.github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:

- name: macOS GCC
os: macos-latest
compiler: gcc-9
compiler: gcc-11

steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion third_party/zlib/.github/workflows/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:

- name: macOS GCC
os: macos-latest
compiler: gcc-9
compiler: gcc-11
configure-args: --warn

- name: macOS Clang
Expand Down
12 changes: 11 additions & 1 deletion third_party/zlib/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,21 @@
/example
/example64
/examplesh
/libz.so*
**/libz.so*
/minigzip
/minigzip64
/minigzipsh
/zlib.pc
/configure.log

.DS_Store
.vs
*.user
*.nupkg
contrib/vstudio/vc143/x86
contrib/vstudio/vc143/x64
contrib/vstudio/vc143/arm
contrib/vstudio/vc143/arm64
contrib/nuget/bin
contrib/nuget/obj
*.included
17 changes: 2 additions & 15 deletions third_party/zlib/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Refer to the "LICENSE" file in the root directory for more information.
#
import("//build/ten_runtime/feature/cmake.gni")
import("//third_party/zlib/output_libs.gni")

config("zlib_header") {
include_dirs = [ "${root_gen_dir}/cmake/zlib/install/include" ]
Expand All @@ -27,19 +28,5 @@ cmake_project("zlib") {
cflags = [ "\"-fPIC\"" ]

outputs_seen_by_ag = []
if (is_win) {
if (is_debug) {
outputs_seen_by_ag += [
"$install_path/lib/zlibd.lib",
"$install_path/lib/zlibstaticd.lib",
]
} else {
outputs_seen_by_ag += [
"$install_path/lib/zlib.lib",
"$install_path/lib/zlibstatic.lib",
]
}
} else {
outputs_seen_by_ag += [ "$install_path/lib/libz.a" ]
}
outputs_seen_by_ag = zlib_output_libs
}
Loading
Loading