-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
ci: E2E workflow, web typecheck job, pre-commit hook, test suite #486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
63b2e1c
7bc0e73
a40e5bd
478159b
9fc3e7a
75ca65d
a6211ad
e5deb8e
a5822d6
54e9f5a
640ba9d
6705f88
af734cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| name: E2E Tests | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| check-changes: | ||
| name: Check web module changes | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| outputs: | ||
| web_changed: ${{ steps.filter.outputs.web }} | ||
| steps: | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
| - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3 | ||
| id: filter | ||
| with: | ||
| filters: | | ||
| web: | ||
| - 'gitnexus-web/**' | ||
|
|
||
| e2e: | ||
| name: e2e (chromium) | ||
| needs: check-changes | ||
| if: needs.check-changes.result == 'success' && needs.check-changes.outputs.web_changed == 'true' | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
| steps: | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
|
|
||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: npm | ||
| cache-dependency-path: gitnexus-web/package-lock.json | ||
|
|
||
| - name: Install frontend dependencies | ||
| run: npm ci | ||
| working-directory: gitnexus-web | ||
|
|
||
| - name: Install Playwright browsers | ||
| run: npx playwright install --with-deps chromium | ||
| working-directory: gitnexus-web | ||
|
|
||
| - name: Install backend dependencies | ||
| run: npm ci | ||
| working-directory: gitnexus | ||
|
|
||
| - name: Build backend | ||
| run: npm run build | ||
| working-directory: gitnexus | ||
|
|
||
| - name: Analyze repository (index for backend) | ||
| run: | | ||
| node gitnexus/dist/cli/index.js analyze || true | ||
| if [ ! -d ".gitnexus" ]; then | ||
| echo "::error::No .gitnexus index created" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Start backend server | ||
| run: node dist/cli/index.js serve & | ||
| working-directory: gitnexus | ||
|
|
||
| - name: Wait for backend readiness | ||
| run: npx wait-on http://localhost:4747/api/repos --timeout 30000 | ||
| working-directory: gitnexus-web | ||
|
|
||
| - name: Start Vite dev server | ||
| run: npm run dev & | ||
| working-directory: gitnexus-web | ||
|
|
||
| - name: Wait for Vite dev server | ||
| run: npx wait-on http://localhost:5173 --timeout 30000 | ||
| working-directory: gitnexus-web | ||
|
|
||
| - name: Run E2E tests | ||
| run: npx playwright test | ||
| working-directory: gitnexus-web | ||
| env: | ||
| E2E: '1' | ||
|
|
||
| - name: Upload test results | ||
| if: always() | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | ||
| with: | ||
| name: e2e-results | ||
| path: | | ||
| gitnexus-web/test-results/ | ||
| gitnexus-web/playwright-report/ | ||
| retention-days: 5 | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -12,3 +12,18 @@ jobs: | |||||
| - uses: ./.github/actions/setup-gitnexus | ||||||
| - run: npx tsc --noEmit | ||||||
| working-directory: gitnexus | ||||||
|
|
||||||
| typecheck-web: | ||||||
| runs-on: ubuntu-latest | ||||||
| timeout-minutes: 10 | ||||||
| steps: | ||||||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||||||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | ||||||
| with: | ||||||
| node-version: 20 | ||||||
|
||||||
| node-version: 20 | |
| node-version: 20.19.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the typecheck workflow: this uses
node-version: 20, but thegitnexus-weblockfile includes packages that require Node^20.19.0+. Pinning to a specific patch (e.g.20.19.0) or moving to22would make E2E runs more reproducible and aligned with the dependency engines.