From 4b37e524cf53ae4a75ebd72242f83038a1d4f58b Mon Sep 17 00:00:00 2001 From: Warren Date: Fri, 19 Jun 2026 04:27:53 +0800 Subject: [PATCH] Add CI Pipeline: build, test, clippy, fmt check - ci.yml: main workflow with build, test, clippy, fmt - macos-build: macOS-specific job - security-audit: dedicated security test job - Remove old linux-test.yml --- .github/workflows/ci.yml | 53 ++++++++++++++++++++++++++++++++ .github/workflows/linux-test.yml | 15 --------- 2 files changed, 53 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/linux-test.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..377d04b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,53 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + + - name: Build + run: cargo build --verbose + + - name: Run tests + run: cargo test --verbose + + - name: Run clippy + run: cargo clippy -- -D warnings + + - name: Check formatting + run: cargo fmt --check + + macos-build: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + + - name: Build + run: cargo build --verbose + + - name: Run tests + run: cargo test --verbose + + security-audit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + + - name: Run security tests + run: cargo test --lib security_audit --verbose \ No newline at end of file diff --git a/.github/workflows/linux-test.yml b/.github/workflows/linux-test.yml deleted file mode 100644 index 49fdca7..0000000 --- a/.github/workflows/linux-test.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Linux Test -on: [push] - -jobs: - linux-test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions-rust-lang/setup-rust-toolchain@v1 - - name: Build Linux version - run: cargo build --release --target x86_64-unknown-linux-gnu - - name: Run Linux test - run: ./target/x86_64-unknown-linux-gnu/release/hybrid-poc-test - - name: Verify ELF format - run: file ./target/x86_64-unknown-linux-gnu/release/hybrid-poc-test