Skip to content

Commit 0196d51

Browse files
committed
ci(workflow): 更新后端工作流以安装sqlx-cli
在生成SQLx元数据之前,显式安装sqlx-cli工具以确保依赖项正确安装,避免工作流执行失败。
1 parent f9130ed commit 0196d51

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/backend.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ jobs:
3939
- name: Create .sqlx directory if it doesn't exist
4040
run: mkdir -p backend/.sqlx
4141
- name: Generate SQLx metadata
42-
run: cd backend && cargo sqlx prepare -- --tests
42+
run: |
43+
cd backend
44+
cargo install sqlx-cli --no-default-features --features postgres
45+
cargo sqlx prepare -- --tests
4346
env:
4447
DATABASE_URL: ${{ secrets.DATABASE_URL }}
4548
SQLX_OFFLINE: true
@@ -90,7 +93,10 @@ jobs:
9093
run: mkdir -p backend/.sqlx
9194

9295
- name: Generate SQLx metadata
93-
run: cd backend && cargo sqlx prepare -- --tests
96+
run: |
97+
cd backend
98+
cargo install sqlx-cli --no-default-features --features postgres
99+
cargo sqlx prepare -- --tests
94100
env:
95101
DATABASE_URL: ${{ secrets.DATABASE_URL }}
96102
SQLX_OFFLINE: true

0 commit comments

Comments
 (0)