From e24c28833629f62d13fa269423e9dd6b3ceea1be Mon Sep 17 00:00:00 2001 From: Jay Zhang Date: Thu, 19 Sep 2024 11:30:25 +0800 Subject: [PATCH] feat: improve mac ci (#28) * feat: only lock llvm and rust version for debug * fix: path setting * fix: llvm18 * feat: remove mac-x64-debug to save action concurrency --------- Co-authored-by: Hu Yueh-Wei --- .github/workflows/build_mac.yml | 38 +++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_mac.yml b/.github/workflows/build_mac.yml index 9827e146a0..7ddb510e8e 100644 --- a/.github/workflows/build_mac.yml +++ b/.github/workflows/build_mac.yml @@ -39,17 +39,29 @@ jobs: - name: Install tools and dependencies run: | - brew install llvm@18 + + if [ ${{ matrix.build_type }} == "debug" ]; then + # Since the TEN runtime and TEN manager are a combination of C and + # Rust, to enable ASan, the ASan versions used by both the C and + # Rust compilation environments must be consistent. Therefore, it is + # necessary to lock the LLVM and Rust versions to enable ASan. + brew install llvm@18 + rustup default nightly-2024-07-19 + else + rustup default nightly + fi + brew install tree pip3 install --use-pep517 python-dotenv jinja2 go install golang.org/dl/go1.20.12@latest && go1.20.12 download go env -w GOFLAGS="-buildvcs=false" - rustup default nightly-2024-07-19 cargo install --force cbindgen - name: Build run: | - export PATH="/opt/homebrew/opt/llvm@18/bin:$PATH" + if [ ${{ matrix.build_type }} == "debug" ]; then + export PATH="/opt/homebrew/opt/llvm@18/bin:$PATH" + 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_test=false @@ -60,7 +72,7 @@ jobs: runs-on: macos-13 strategy: matrix: - build_type: [debug, release] + build_type: [release] steps: - uses: actions/checkout@v4 with: @@ -78,17 +90,29 @@ jobs: - name: Install tools and dependencies run: | - brew install llvm@18 + + if [ ${{ matrix.build_type }} == "debug" ]; then + # Since the TEN runtime and TEN manager are a combination of C and + # Rust, to enable ASan, the ASan versions used by both the C and + # Rust compilation environments must be consistent. Therefore, it is + # necessary to lock the LLVM and Rust versions to enable ASan. + brew install llvm@18 + rustup default nightly-2024-07-19 + else + rustup default nightly + fi + brew install tree pip3 install --use-pep517 python-dotenv jinja2 go install golang.org/dl/go1.20.12@latest && go1.20.12 download go env -w GOFLAGS="-buildvcs=false" - rustup default nightly-2024-07-19 cargo install --force cbindgen - name: Build run: | - export PATH="/usr/local/opt/llvm@18/bin:$PATH" + if [ ${{ matrix.build_type }} == "debug" ]; then + export PATH="/usr/local/opt/llvm@18/bin:$PATH" + 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_test=false