fix(install): 修复 PowerShell 中 docker compose 命令执行失败 #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: E2E System Tests | |
| on: | |
| push: | |
| branches: [ "master", "main" ] | |
| pull_request: | |
| branches: [ "master", "main" ] | |
| workflow_dispatch: | |
| jobs: | |
| e2e-tests: | |
| if: contains(github.event.head_commit.message, '执行测试') | |
| timeout-minutes: 20 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v3 | |
| with: | |
| version: 9 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - name: Setup pnpm cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install website dependencies | |
| working-directory: package/website | |
| run: pnpm install | |
| - name: Install Playwright Browsers | |
| working-directory: package/website | |
| run: pnpm exec playwright install --with-deps chromium | |
| - name: Build local Docker images for E2E | |
| run: | | |
| # Build server image | |
| docker build -t siyuan044/trailsnap-server:master -f package/server/Dockerfile package/server | |
| # Build frontend image (Note: Ensure your frontend Dockerfile is correct for local builds) | |
| docker build -t siyuan044/trailsnap-frontend:master -f package/website/Dockerfile package/website | |
| - name: Start E2E Environment | |
| shell: pwsh | |
| run: ./tests/scripts/e2e-up.ps1 | |
| - name: Run E2E Tests | |
| shell: pwsh | |
| run: ./tests/scripts/e2e-run.ps1 | |
| - name: Stop E2E Environment and Collect Logs | |
| if: always() | |
| shell: pwsh | |
| run: ./tests/scripts/e2e-down.ps1 | |
| - name: Upload Playwright Report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report | |
| path: package/website/.playwright-system/report/ | |
| retention-days: 7 | |
| - name: Upload Docker Logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docker-logs | |
| path: tests/artifacts/ | |
| retention-days: 7 |