fix: 使用原生 ARM64 runner 修复 Linux ARM64 构建

- 将 Linux ARM64 平台从 ubuntu-22.04 改为 ubuntu-22.04-arm
- 简化 Linux 依赖安装步骤,移除交叉编译配置
- 修复测试文件编译错误

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
coso
2025-12-29 14:11:28 +08:00
co-authored by Claude Opus 4.5
parent 3f6479b1ad
commit cb25e1cc5e
2 changed files with 8 additions and 33 deletions
+4 -30
View File
@@ -32,7 +32,8 @@ jobs:
- platform: ubuntu-22.04
target: x86_64-unknown-linux-gnu
name: Linux-x64
- platform: ubuntu-22.04
# 使用原生 ARM64 runner 而非交叉编译
- platform: ubuntu-22.04-arm
target: aarch64-unknown-linux-gnu
name: Linux-arm64
@@ -48,39 +49,12 @@ jobs:
node-version: '20'
cache: 'npm'
- name: Install Linux dependencies (x64)
if: matrix.platform == 'ubuntu-22.04' && matrix.target == 'x86_64-unknown-linux-gnu'
- name: Install Linux dependencies
if: startsWith(matrix.platform, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install Linux ARM64 cross-compilation dependencies
if: matrix.platform == 'ubuntu-22.04' && matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
# 添加 ARM64 架构支持
sudo dpkg --add-architecture arm64
sudo apt-get update
# 安装 ARM64 系统库
sudo apt-get install -y \
libwebkit2gtk-4.1-dev:arm64 \
libappindicator3-dev:arm64 \
librsvg2-dev:arm64 \
libssl-dev:arm64 \
libgtk-3-dev:arm64
# 设置 PKG_CONFIG 环境变量
echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV
# 设置 Cargo 环境变量
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
echo "CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
echo "CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++" >> $GITHUB_ENV
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
+4 -3
View File
@@ -3,8 +3,8 @@
//! 测试 AsterClient 的序列化、反序列化和 URL 格式
use proxycast_lib::agent::{
AsterClient, ChatRequest, ChatResponse, CreateAgentData, CreateAgentRequest,
CreateAgentResponse, ModelConfig, SendToAgentRequest, SendToAgentResponse,
AsterClient, ChatRequest, ChatResponse, CreateAgentRequest, CreateAgentResponse, ModelConfig,
SendToAgentRequest, SendToAgentResponse,
};
#[test]
@@ -79,7 +79,8 @@ fn test_chat_request_serialization() {
let request = ChatRequest {
template_id: "chat".to_string(),
input: "Hello, world!".to_string(),
input: Some("Hello, world!".to_string()),
images: None,
model_config: Some(config),
};