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

refactor: refine build script #79

Merged
merged 3 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
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
Loading