From 1f5dacd218d0920bd04b7da448f39beb3a532b80 Mon Sep 17 00:00:00 2001 From: Joe Date: Thu, 12 Mar 2026 20:41:34 -0500 Subject: [PATCH] chore: update CI configuration and Rust settings - Added support for `lld-link` as the linker for both x86_64 and aarch64 Windows targets in `.cargo/config.toml`. - Updated CI workflows to use `Swatinem/rust-cache` for caching Rust dependencies, improving build efficiency. - Consolidated build and test steps in CI workflows, enhancing clarity and reducing redundancy. - Introduced a step to disable Windows Defender during CI runs on Windows to prevent interference with builds. --- .cargo/config.toml | 7 +++- .github/workflows/ci.yml | 74 ++++++++--------------------------- .github/workflows/release.yml | 27 +++++-------- 3 files changed, 33 insertions(+), 75 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 0beee4e0..eb6f7479 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,7 @@ [target.x86_64-pc-windows-msvc] -rustflags = ["-Ctarget-feature=+crt-static"] \ No newline at end of file +rustflags = ["-Ctarget-feature=+crt-static"] +linker = "lld-link" + +[target.aarch64-pc-windows-msvc] +rustflags = ["-Ctarget-feature=+crt-static"] +linker = "lld-link" \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da84d39c..7cd2ce5d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,10 @@ jobs: os: [ubuntu-22.04, windows-latest, macos-latest, windows-11-arm, ubuntu-22.04-arm] steps: + - name: Disable Windows Defender + if: runner.os == 'Windows' + run: Set-MpPreference -DisableRealtimeMonitoring $true + - uses: actions/checkout@v4 with: submodules: true @@ -27,29 +31,13 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable - - name: Restore Rust Cache - uses: actions/cache/restore@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Rust Cache + uses: Swatinem/rust-cache@v2 - - name: Build - run: cargo build --locked --verbose - - - name: Test - run: cargo test --locked --verbose - - - name: Save Rust Cache - uses: actions/cache/save@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Build and Test + env: + CARGO_TERM_VERBOSE: ${{ runner.debug && 'true' || 'false' }} + run: cargo test --locked --all-targets build-vscode: name: Build VS Code Extension @@ -85,26 +73,13 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@1.88.0 - - name: Restore Rust Cache - uses: actions/cache/restore@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Rust Cache + uses: Swatinem/rust-cache@v2 - name: Build - run: cargo build --locked --verbose - - - name: Save Rust Cache - uses: actions/cache/save@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + env: + CARGO_TERM_VERBOSE: ${{ runner.debug && 'true' || 'false' }} + run: cargo build --locked lint: name: Rustfmt, Clippy, Stylua, & Selene @@ -120,14 +95,8 @@ jobs: with: components: rustfmt, clippy - - name: Restore Rust Cache - uses: actions/cache/restore@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Rust Cache + uses: Swatinem/rust-cache@v2 - name: Setup Rokit uses: CompeyDev/setup-rokit@v0.1.2 @@ -145,12 +114,3 @@ jobs: - name: Clippy run: cargo clippy - - - name: Save Rust Cache - uses: actions/cache/save@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 447eae0e..b3669ea3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -135,6 +135,10 @@ jobs: env: BIN: atlas steps: + - name: Disable Windows Defender + if: runner.os == 'Windows' + run: Set-MpPreference -DisableRealtimeMonitoring $true + - uses: actions/checkout@v4 with: submodules: true @@ -144,26 +148,15 @@ jobs: with: targets: ${{ matrix.target }} - - name: Restore Rust Cache - uses: actions/cache/restore@v4 + - name: Rust Cache + uses: Swatinem/rust-cache@v2 with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + shared-key: release-${{ matrix.target }} - name: Build Release - run: cargo build --release --locked --verbose --target ${{ matrix.target }} - - - name: Save Rust Cache - uses: actions/cache/save@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + env: + CARGO_TERM_VERBOSE: ${{ runner.debug && 'true' || 'false' }} + run: cargo build --release --locked --target ${{ matrix.target }} - name: Generate Artifact Name shell: bash