mirror of
https://github.com/AppFlowy-IO/AppFlowy-Web.git
synced 2026-03-13 10:00:26 +08:00
Merge branch 'main' into e2e_test
This commit is contained in:
24
.github/workflows/web_ci.yaml
vendored
24
.github/workflows/web_ci.yaml
vendored
@@ -82,15 +82,15 @@ jobs:
|
||||
set -e
|
||||
echo "Testing container fails without environment variables..."
|
||||
OUTPUT=$(docker run --rm appflowy-web-test:ci 2>&1 || true)
|
||||
echo "$OUTPUT" | grep -q "ERROR: AF_BASE_URL environment variable is required" || (echo "ERROR: Container should fail without env vars" && exit 1)
|
||||
echo "$OUTPUT" | grep -q "ERROR: APPFLOWY_BASE_URL environment variable is required" || (echo "ERROR: Container should fail without env vars" && exit 1)
|
||||
echo "✓ Container correctly fails without required env vars"
|
||||
|
||||
- name: Run container with injected env vars
|
||||
run: |
|
||||
docker run -d --rm --name appflowy-web-test -p 8080:80 \
|
||||
-e AF_BASE_URL=https://ci-backend.example.com \
|
||||
-e AF_GOTRUE_URL=https://ci-backend.example.com/gotrue \
|
||||
-e AF_WS_V2_URL=wss://ci-backend.example.com/ws/v2 \
|
||||
-e APPFLOWY_BASE_URL=https://ci-backend.example.com \
|
||||
-e APPFLOWY_GOTRUE_BASE_URL=https://ci-backend.example.com/gotrue \
|
||||
-e APPFLOWY_WS_BASE_URL=wss://ci-backend.example.com/ws/v2 \
|
||||
appflowy-web-test:ci
|
||||
|
||||
- name: Wait for server to be ready
|
||||
@@ -111,15 +111,15 @@ jobs:
|
||||
echo "✓ Found window.__APP_CONFIG__"
|
||||
|
||||
echo "Verifying injected values..."
|
||||
# Note: The config is injected as a single line with format: {AF_BASE_URL:'value',AF_GOTRUE_URL:'value',AF_WS_V2_URL:'value'}
|
||||
echo "$HTML" | grep -q "AF_BASE_URL:'https://ci-backend.example.com'" || (echo "ERROR: AF_BASE_URL not correctly injected" && exit 1)
|
||||
echo "✓ AF_BASE_URL correctly injected"
|
||||
# Note: The config is injected as a single line with format: {APPFLOWY_BASE_URL:'value',APPFLOWY_GOTRUE_BASE_URL:'value',APPFLOWY_WS_BASE_URL:'value'}
|
||||
echo "$HTML" | grep -q "APPFLOWY_BASE_URL:'https://ci-backend.example.com'" || (echo "ERROR: APPFLOWY_BASE_URL not correctly injected" && exit 1)
|
||||
echo "✓ APPFLOWY_BASE_URL correctly injected"
|
||||
|
||||
echo "$HTML" | grep -q "AF_GOTRUE_URL:'https://ci-backend.example.com/gotrue'" || (echo "ERROR: AF_GOTRUE_URL not correctly injected" && exit 1)
|
||||
echo "✓ AF_GOTRUE_URL correctly injected"
|
||||
echo "$HTML" | grep -q "APPFLOWY_GOTRUE_BASE_URL:'https://ci-backend.example.com/gotrue'" || (echo "ERROR: APPFLOWY_GOTRUE_BASE_URL not correctly injected" && exit 1)
|
||||
echo "✓ APPFLOWY_GOTRUE_BASE_URL correctly injected"
|
||||
|
||||
echo "$HTML" | grep -q "AF_WS_V2_URL:'wss://ci-backend.example.com/ws/v2'" || (echo "ERROR: AF_WS_V2_URL not correctly injected" && exit 1)
|
||||
echo "✓ AF_WS_V2_URL correctly injected"
|
||||
echo "$HTML" | grep -q "APPFLOWY_WS_BASE_URL:'wss://ci-backend.example.com/ws/v2'" || (echo "ERROR: APPFLOWY_WS_BASE_URL not correctly injected" && exit 1)
|
||||
echo "✓ APPFLOWY_WS_BASE_URL correctly injected"
|
||||
|
||||
echo "All runtime configuration values verified successfully!"
|
||||
|
||||
@@ -133,7 +133,7 @@ jobs:
|
||||
echo "Extracted config: $CONFIG"
|
||||
|
||||
# Verify it's a valid JavaScript object format
|
||||
echo "$CONFIG" | grep -q "window.__APP_CONFIG__={AF_BASE_URL:'[^']*',AF_GOTRUE_URL:'[^']*',AF_WS_V2_URL:'[^']*'}" || \
|
||||
echo "$CONFIG" | grep -q "window.__APP_CONFIG__={APPFLOWY_BASE_URL:'[^']*',APPFLOWY_GOTRUE_BASE_URL:'[^']*',APPFLOWY_WS_BASE_URL:'[^']*'}" || \
|
||||
(echo "ERROR: Config format is invalid" && exit 1)
|
||||
|
||||
echo "✓ Configuration format and structure verified"
|
||||
|
||||
Reference in New Issue
Block a user