|
58 | 58 | uses: ./.github/actions/setup-node-pnpm |
59 | 59 | - name: Run unit tests |
60 | 60 | run: pnpm test |
61 | | - |
62 | | - check-openrouter-api-key: |
63 | | - runs-on: ubuntu-latest |
64 | | - outputs: |
65 | | - exists: ${{ steps.openrouter-api-key-check.outputs.defined }} |
66 | | - steps: |
67 | | - - name: Check if OpenRouter API key exists |
68 | | - id: openrouter-api-key-check |
69 | | - shell: bash |
70 | | - run: | |
71 | | - if [ "${{ secrets.OPENROUTER_API_KEY }}" != '' ]; then |
72 | | - echo "defined=true" >> $GITHUB_OUTPUT; |
73 | | - else |
74 | | - echo "defined=false" >> $GITHUB_OUTPUT; |
75 | | - fi |
76 | | -
|
77 | | - integration-test: |
78 | | - runs-on: ubuntu-latest |
79 | | - needs: [check-openrouter-api-key] |
80 | | - if: needs.check-openrouter-api-key.outputs.exists == 'true' |
81 | | - steps: |
82 | | - - name: Checkout code |
83 | | - uses: actions/checkout@v4 |
84 | | - - name: Setup Node.js and pnpm |
85 | | - uses: ./.github/actions/setup-node-pnpm |
86 | | - - name: Create .env.local file |
87 | | - working-directory: apps/vscode-e2e |
88 | | - run: echo "OPENROUTER_API_KEY=${{ secrets.OPENROUTER_API_KEY }}" > .env.local |
89 | | - - name: Set VS Code test version |
90 | | - run: echo "VSCODE_VERSION=1.101.2" >> $GITHUB_ENV |
91 | | - - name: Cache VS Code test runtime |
92 | | - uses: actions/cache@v4 |
93 | | - with: |
94 | | - path: apps/vscode-e2e/.vscode-test |
95 | | - key: ${{ runner.os }}-vscode-test-${{ env.VSCODE_VERSION }} |
96 | | - - name: Pre-download VS Code test runtime with retry |
97 | | - working-directory: apps/vscode-e2e |
98 | | - run: | |
99 | | - for attempt in 1 2 3; do |
100 | | - echo "Download attempt $attempt of 3..." |
101 | | - node -e " |
102 | | - const { downloadAndUnzipVSCode } = require('@vscode/test-electron'); |
103 | | - downloadAndUnzipVSCode({ version: process.env.VSCODE_VERSION || '1.101.2' }) |
104 | | - .then(() => { |
105 | | - console.log('✅ VS Code test runtime downloaded successfully'); |
106 | | - process.exit(0); |
107 | | - }) |
108 | | - .catch(err => { |
109 | | - console.error('❌ Failed to download VS Code (attempt $attempt):', err); |
110 | | - process.exit(1); |
111 | | - }); |
112 | | - " && break || { |
113 | | - if [ $attempt -eq 3 ]; then |
114 | | - echo "All download attempts failed" |
115 | | - exit 1 |
116 | | - fi |
117 | | - echo "Retrying in 5 seconds..." |
118 | | - sleep 5 |
119 | | - } |
120 | | - done |
121 | | - - name: Run integration tests |
122 | | - working-directory: apps/vscode-e2e |
123 | | - run: xvfb-run -a pnpm test:ci |
0 commit comments