Skip to content

Commit

Permalink
refactor: refine build script (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
halajohn authored Oct 8, 2024
1 parent f95f231 commit 609339f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 4 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/build_linux_ubuntu1804.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,19 @@ jobs:
echo $PATH
go env -w GOFLAGS="-buildvcs=false"
rustup default nightly
tgn gen linux x64 ${{ matrix.build_type }} -- is_clang=false log_level=1 enable_serialized_actions=true ten_enable_tests=false ten_enable_package_manager=false
tgn gen linux x64 ${{ matrix.build_type }} -- is_clang=false log_level=1 enable_serialized_actions=true ten_enable_integration_tests=false ten_enable_private_tests=false ten_rust_enable_tests=false ten_enable_package_manager=false
tgn build linux x64 ${{ matrix.build_type }}
tree -I 'gen|obj' out
- name: Run Tests
run: |
chmod +x out/linux/x64/tests/standalone/ten_utils_unit_test
out/linux/x64/tests/standalone/ten_utils_unit_test
chmod +x out/linux/x64/tests/standalone/ten_runtime_unit_test
out/linux/x64/tests/standalone/ten_runtime_unit_test
chmod +x out/linux/x64/tests/standalone/ten_runtime_smoke_test
out/linux/x64/tests/standalone/ten_runtime_smoke_test
- name: Upload ten_packages
uses: actions/upload-artifact@v3
with:
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/build_linux_ubuntu2204.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,19 @@ jobs:
go env -w GOFLAGS="-buildvcs=false"
go1.20.12 download
rustup default nightly
tgn gen linux x64 ${{ matrix.build_type }} -- is_clang=${{ matrix.compiler == 'gcc' && 'false' || 'true' }} log_level=1 enable_serialized_actions=true ten_enable_tests=false
tgn gen linux x64 ${{ matrix.build_type }} -- is_clang=${{ matrix.compiler == 'gcc' && 'false' || 'true' }} 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 linux x64 ${{ matrix.build_type }}
tree -I 'gen|obj' out
- name: Run Tests
run: |
chmod +x out/linux/x64/tests/standalone/ten_utils_unit_test
out/linux/x64/tests/standalone/ten_utils_unit_test
chmod +x out/linux/x64/tests/standalone/ten_runtime_unit_test
out/linux/x64/tests/standalone/ten_runtime_unit_test
chmod +x out/linux/x64/tests/standalone/ten_runtime_smoke_test
out/linux/x64/tests/standalone/ten_runtime_smoke_test
- name: Upload tman
uses: actions/upload-artifact@v4
with:
Expand Down
5 changes: 5 additions & 0 deletions build/ten_manager/options.gni
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@
declare_args() {
ten_package_manager_enable_publish = target_cpu != "arm64"
}

declare_args() {
ten_package_manager_enable_tests =
is_linux || is_win || (is_mac && target_cpu == "x64")
}
3 changes: 2 additions & 1 deletion core/src/ten_manager/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
#
import("//build/common/rust/rust.gni")
import("//build/feature/ten_package.gni")
import("//build/ten_manager/options.gni")
import("//third_party/clingo/output_libs.gni")

declare_args() {
use_shared_lib = false
}

if (ten_enable_package_manager) {
if (is_linux || is_win || (is_mac && target_cpu == "x64")) {
if (ten_package_manager_enable_tests) {
rust_test("tman_test") {
project_path = "//core/src/ten_manager"

Expand Down
3 changes: 2 additions & 1 deletion tests/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Licensed under the Apache License, Version 2.0, with certain conditions.
# Refer to the "LICENSE" file in the root directory for more information.
#
import("//build/ten_manager/options.gni")
import("//build/ten_runtime/options.gni")
import("//build/ten_utils/options.gni")
import("//third_party/jansson/output_libs.gni")
Expand Down Expand Up @@ -34,7 +35,7 @@ group("tests") {
"ten_manager",
]

if (is_linux || is_win || (is_mac && target_cpu == "x64")) {
if (ten_package_manager_enable_tests) {
deps += [ "//core/src/ten_manager:tman_test" ]
}
}
Expand Down

0 comments on commit 609339f

Please sign in to comment.