Skip to content

Commit 569e60a

Browse files
committed
chore: update GitHub Actions workflows for improved dependency management and rebase strategy
- Modified the generate-client workflow to use rebase instead of pull for better conflict resolution. - Added a step in the test-backend workflow to install backend dependencies before running migrations and tests. - Updated the test-docker-compose workflow to include a health check for the admin service. - Enhanced the use-make-test workflow to install dependencies for frontend, admin, and extension directories separately, ensuring all necessary packages are available before executing make commands.
1 parent 1666a96 commit 569e60a

File tree

4 files changed

+24
-11
lines changed

4 files changed

+24
-11
lines changed

.github/workflows/generate-client.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ jobs:
9191
# Check if there are staged changes
9292
if ! git diff --staged --quiet; then
9393
echo "✅ Changes detected in generated client. Committing and pushing..."
94-
# Pull before pushing to avoid conflicts if possible (optional)
95-
git pull --ff-only origin ${{ github.head_ref || github.ref_name }}
94+
# Pull before pushing to avoid conflicts using rebase
95+
git pull --rebase origin ${{ github.head_ref || github.ref_name }}
9696
git commit -m "ci: ✨ Autogenerate frontend client"
9797
git push origin HEAD:${{ github.head_ref || github.ref_name }}
9898
else

.github/workflows/test-backend.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@ jobs:
4343

4444
- run: docker compose --project-name $STACK_NAME down -v --remove-orphans
4545
- run: docker compose --project-name $STACK_NAME up -d db mailcatcher
46+
- name: Install dependencies
47+
run: docker compose --project-name $STACK_NAME run --rm backend uv pip install -e .
4648
- name: Migrate DB
4749
run: docker compose --project-name $STACK_NAME run --rm backend uv run bash scripts/prestart.sh
4850
working-directory: backend
51+
4952
- name: Run tests
5053
run: docker compose --project-name $STACK_NAME run --rm backend uv run bash scripts/tests-start.sh "Coverage for ${{ github.sha }}"
5154
working-directory: backend

.github/workflows/test-docker-compose.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,16 @@ jobs:
3939
run: |
4040
docker compose down -v --remove-orphans
4141
docker compose build
42-
docker compose up -d --wait backend frontend pgadmin
42+
docker compose up -d --wait backend frontend admin pgadmin
4343
4444
- name: Test backend is up
4545
run: curl http://localhost:8000/api/v1/utils/health-check
4646

4747
- name: Test frontend is up
4848
run: curl http://localhost:5173
4949

50+
- name: Test admin is up
51+
run: curl http://localhost:3000
52+
5053
- name: Clean up
5154
run: docker compose down -v --remove-orphans

.github/workflows/use-make-test.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,24 @@ jobs:
2020
with:
2121
python-version: "3.10"
2222
- name: Install uv
23-
uses: astral-sh/setup-uv@v6
24-
with:
25-
version: "0.4.15"
26-
enable-cache: true
23+
uses: astral-sh/setup-uv@v5
2724
- name: Install pnpm
2825
uses: pnpm/action-setup@v3
2926
with:
30-
run_install: |
31-
- pnpm install --dir frontend
32-
- pnpm install --dir admin
33-
- pnpm install --dir extension
27+
version: 8
28+
29+
# 分别安装各个目录的依赖
30+
- name: Install frontend dependencies
31+
run: pnpm install --dir frontend
32+
if: hashFiles('frontend/package.json') != ''
33+
34+
- name: Install admin dependencies
35+
run: pnpm install --dir admin
36+
if: hashFiles('admin/package.json') != ''
37+
38+
- name: Install extension dependencies
39+
run: pnpm install --dir extension
40+
if: hashFiles('extension/package.json') != ''
3441

3542
- name: Make all
3643
run: make all

0 commit comments

Comments
 (0)