Skip to content

Commit 8503701

Browse files
authored
Merge pull request #38 from telepace/feat/deployment-project
refactor: update README files to reflect project name change from Qui…
2 parents abe23a9 + c137d78 commit 8503701

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+574
-8763
lines changed

.github/workflows/generate-client.yml

Lines changed: 17 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,28 @@ name: Generate Client
33

44
on:
55
pull_request:
6-
types:
7-
- opened
8-
- synchronize
9-
push: # Also consider running on push to main/main to ensure consistency
10-
branches:
11-
- main # Or your default branch
6+
types: [opened, synchronize]
7+
push:
8+
branches: [main]
129

1310
permissions:
14-
contents: write # Needed for pushing commits on same-repo events
11+
contents: write
1512

1613
jobs:
1714
generate-client:
1815
runs-on: ubuntu-latest
16+
1917
steps:
20-
# 1. Checkout Code - Single step handles both fork and same-repo PRs/pushes
2118
- name: Checkout Code
2219
uses: actions/checkout@v4
23-
# Fetch depth 0 is needed for accurate diff/commit history if required elsewhere
24-
# For pushing back, fetch the specific ref for same-repo PRs
2520
with:
2621
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && github.head_ref || '' }}
27-
# Use a PAT for same-repo events if you need to trigger other workflows
28-
# Standard GITHUB_TOKEN is often sufficient for basic pushes
29-
# token: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && secrets.YOUR_PAT_OR_GITHUB_TOKEN || '' }}
3022

31-
# 2. Setup Environment
3223
- name: Setup pnpm
3324
uses: pnpm/action-setup@v3
3425
with:
3526
version: 9.9.0
36-
27+
3728
- name: Setup Node.js
3829
uses: actions/setup-node@v4
3930
with:
@@ -46,34 +37,27 @@ jobs:
4637
with:
4738
python-version: "3.10"
4839

49-
- name: Install uv (Python Package Installer)
50-
uses: astral-sh/setup-uv@v1 # Use v1 for stable release
40+
- name: Install uv
41+
uses: astral-sh/setup-uv@v1
5142
with:
52-
# version: "0.4.15" # Specifying version is optional, can use latest stable
5343
enable-cache: true
5444

55-
# 3. Install Dependencies
5645
- name: Install Frontend Dependencies
5746
run: pnpm install
5847
working-directory: frontend
59-
48+
6049
- name: Install Admin Dependencies
6150
run: pnpm install
6251
working-directory: admin
6352

64-
# 安装所有后端依赖项
6553
- name: Install Backend Dependencies
6654
run: |
6755
uv sync
6856
source .venv/bin/activate
6957
pip install .
7058
working-directory: backend
7159

72-
# 4. Run Generation Script with Error Handling
7360
- name: Generate Client
74-
# Use `uv run` to execute within the backend context if needed,
75-
# or just run the script directly if VIRTUAL_ENV isn't strictly necessary
76-
# for the script itself (it might just need python)
7761
run: |
7862
make generate-client || {
7963
echo "❌ Failed to run generate-client.sh script."
@@ -87,17 +71,14 @@ jobs:
8771
SENTRY_DSN: ""
8872
POSTHOG_API_KEY: ""
8973
POSTHOG_HOST: ""
90-
# VIRTUAL_ENV might not be needed if uv sync --system is used
9174
VIRTUAL_ENV: .venv
9275

93-
# 5. Configure Git User
9476
- name: Configure Git User
9577
run: |
96-
git config --local user.email "github-actions[bot]@users.noreply.github.com"
97-
git config --local user.name "github-actions[bot]"
78+
git config --global user.email "github-actions@github.com"
79+
git config --global user.name "GitHub Actions"
9880
99-
# 6. Stage Generated Files
100-
- name: Stage Generated Client Files
81+
- name: Stage Generated Files
10182
run: |
10283
git add frontend/app/openapi-client
10384
git add admin/src/client
@@ -110,18 +91,17 @@ jobs:
11091
# Check if there are staged changes
11192
if ! git diff --staged --quiet; then
11293
echo "✅ Changes detected in generated client. Committing and pushing..."
113-
# Pull before pushing to avoid conflicts
94+
# Pull before pushing to avoid conflicts using rebase
95+
git commit -a -m "ci: ✨ Autogenerate frontend client"
11496
git pull --rebase origin ${{ github.head_ref || github.ref_name }}
115-
git commit -m "ci: ✨ Autogenerate frontend client"
97+
git commit -a -m "ci: ✨ Autogenerate frontend client"
11698
git push origin HEAD:${{ github.head_ref || github.ref_name }}
11799
else
118100
echo "✅ No changes detected in generated client."
119101
fi
120102
env:
121103
# GITHUB_TOKEN has write permissions for same-repo events by default
122-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123-
# Use a PAT if you need to trigger subsequent workflows:
124-
# GITHUB_TOKEN: ${{ secrets.YOUR_PAT_WITH_WRITE_ACCESS }}
104+
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
125105

126106
# 8. Handle Changes for Fork PRs (Warn, Don't Fail)
127107
- name: Check for Uncommitted Changes (Fork PRs)
@@ -137,4 +117,4 @@ jobs:
137117
# DO NOT exit 1 - Allow the workflow to continue
138118
else
139119
echo "✅ No changes detected in generated client."
140-
fi
120+
fi

.github/workflows/lint-backend.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/playwright.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ jobs:
5151
uses: pnpm/action-setup@v3
5252
with:
5353
version: 9.9.0
54+
- name: Symlink pnpm-lock.yaml to root
55+
run: ln -s frontend/pnpm-lock.yaml pnpm-lock.yaml
5456
- uses: actions/setup-node@v4
5557
with:
5658
node-version: lts/*
@@ -109,9 +111,14 @@ jobs:
109111
runs-on: ubuntu-latest
110112
steps:
111113
- uses: actions/checkout@v4
114+
- name: Install pnpm
115+
uses: pnpm/action-setup@v3
116+
with:
117+
version: 9.9.0
112118
- uses: actions/setup-node@v4
113119
with:
114120
node-version: 20
121+
cache: 'pnpm'
115122
- name: Install dependencies
116123
run: pnpm install --frozen-lockfile
117124
working-directory: frontend

.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: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Use Make All Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types:
9+
- opened
10+
- synchronize
11+
12+
jobs:
13+
lint-backend:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: "3.10"
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v5
24+
- name: Install pnpm
25+
uses: pnpm/action-setup@v3
26+
with:
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') != ''
41+
42+
- name: Make all
43+
run: make all

0 commit comments

Comments
 (0)