Files
dify/.github/workflows/cli-e2e.yml
gigglewang0417 e0e0ae372a ci(cli-e2e): remove Dify stack build, read env from Secrets
Drop the middleware/API/provision steps that spun up a full Dify
Docker stack. All DIFY_E2E_* vars are now injected from repository
Secrets so the workflow targets an existing staging server instead
of building one on every run.

Also removed: dify_version input (no longer needed), Dump Dify logs
step (no Docker stack to inspect). Timeout reduced from 45→30 min.
2026-05-27 17:30:02 +08:00

92 lines
3.5 KiB
YAML

name: CLI E2E Tests
on:
workflow_dispatch:
inputs:
cli_ref:
description: "Git ref to build the CLI from (default: current branch)"
type: string
required: false
test_scope:
description: "Test scope to run"
type: choice
required: false
default: smoke
options:
- smoke # [P0] cases only — fast
- full # all cases
permissions:
contents: read
jobs:
e2e:
name: E2E — difyctl
runs-on: ubuntu-latest
timeout-minutes: 30
defaults:
run:
shell: bash
steps:
# ── Checkout ───────────────────────────────────────────────────────────
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
with:
ref: ${{ inputs.cli_ref || github.ref }}
persist-credentials: false
# ── Runtime setup ──────────────────────────────────────────────────────
- name: Setup web environment
uses: ./.github/actions/setup-web
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
# Re-initialise pnpm to match the CLI's packageManager (pnpm@11.x).
# setup-web installs pnpm@9 via setup-vp; this step overrides it so
# the CLI workspace uses the correct version declared in cli/package.json.
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
with:
package_json_field: packageManager
run_install: false
- name: Install CLI dependencies
working-directory: cli
run: pnpm install --frozen-lockfile
- name: Generate command tree
working-directory: cli
run: pnpm tree:gen
# ── Run E2E tests ──────────────────────────────────────────────────────
- name: Run E2E tests (${{ inputs.test_scope || 'smoke' }})
working-directory: cli
env:
DIFY_E2E_HOST: ${{ secrets.DIFY_E2E_HOST }}
DIFY_E2E_TOKEN: ${{ secrets.DIFY_E2E_TOKEN }}
DIFY_E2E_WORKSPACE_ID: ${{ secrets.DIFY_E2E_WORKSPACE_ID }}
DIFY_E2E_WORKSPACE_NAME: ${{ secrets.DIFY_E2E_WORKSPACE_NAME }}
DIFY_E2E_CHAT_APP_ID: ${{ secrets.DIFY_E2E_CHAT_APP_ID }}
DIFY_E2E_WORKFLOW_APP_ID: ${{ secrets.DIFY_E2E_WORKFLOW_APP_ID }}
DIFY_E2E_EMAIL: ${{ secrets.DIFY_E2E_EMAIL }}
DIFY_E2E_PASSWORD: ${{ secrets.DIFY_E2E_PASSWORD }}
DIFY_E2E_HITL_APP_ID: ${{ secrets.DIFY_E2E_HITL_APP_ID }}
DIFY_E2E_FILE_APP_ID: ${{ secrets.DIFY_E2E_FILE_APP_ID }}
run: |
if [ "${{ inputs.test_scope }}" = "full" ]; then
pnpm test:e2e
else
pnpm test:e2e:smoke
fi
# ── Upload results ─────────────────────────────────────────────────────
- name: Upload test results on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: e2e-results-${{ github.run_id }}
path: cli/test-results/
retention-days: 3