From 34b683989723d7687c4ee0c449bdcc7d7c9d5a44 Mon Sep 17 00:00:00 2001 From: Warren Date: Sat, 16 May 2026 16:41:26 +0800 Subject: [PATCH] fix: replace GitHub Action with native rustup installation - Replace actions-rust-lang/setup-rust-toolchain@v1 with curl | sh - Fix bash compatibility issue with Gitea Runner - Add 'source /Users/accusys/.cargo/env' for all cargo commands - This should resolve the 'conditional binary operator expected' error --- .gitea/workflows/test.yml | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 5a75b7f..806bac2 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -15,9 +15,9 @@ jobs: run: mkdir -p data/users data/cache - name: Setup Rust - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - toolchain: stable + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable + source $HOME/.cargo/env - name: Cache cargo uses: actions/cache@v3 @@ -35,13 +35,19 @@ jobs: run: brew install switchaudio-source - name: Run tests - run: cargo test --all + run: | + source $HOME/.cargo/env + cargo test --all - name: Run clippy - run: cargo clippy --all-targets --all-features -- -D warnings + run: | + source $HOME/.cargo/env + cargo clippy --all-targets --all-features -- -D warnings - name: Check formatting - run: cargo fmt -- --check + run: | + source $HOME/.cargo/env + cargo fmt -- --check - name: Clean test databases run: rm -f data/users/test_*.sqlite @@ -54,9 +60,9 @@ jobs: uses: actions/checkout@v3 - name: Setup Rust - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - toolchain: stable + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable + source $HOME/.cargo/env - name: Cache cargo uses: actions/cache@v3 @@ -68,7 +74,9 @@ jobs: key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Build release - run: cargo build --release + run: | + source $HOME/.cargo/env + cargo build --release - name: Upload artifact uses: actions/upload-artifact@v3