mirror of
https://github.com/n8n-io/n8n.git
synced 2026-08-30 18:01:23 +08:00
ci: Add ui-e2e to codecov reports (#22996)
This commit is contained in:
@@ -22,15 +22,21 @@ jobs:
|
||||
|
||||
- name: Setup Environment
|
||||
uses: ./.github/actions/setup-nodejs-blacksmith
|
||||
with:
|
||||
build-command: pnpm turbo build:playwright
|
||||
env:
|
||||
INCLUDE_TEST_CONTROLLER: 'true'
|
||||
|
||||
- name: Build with Coverage
|
||||
run: pnpm --filter n8n-editor-ui build:coverage
|
||||
- name: Build Docker Image with Coverage
|
||||
run: pnpm build:docker:coverage
|
||||
env:
|
||||
INCLUDE_TEST_CONTROLLER: 'true'
|
||||
|
||||
- name: Run Coverage Tests
|
||||
- name: Install Browsers
|
||||
run: pnpm turbo install-browsers:ci
|
||||
|
||||
- name: Run Container Coverage Tests
|
||||
id: coverage-tests
|
||||
run: |
|
||||
pnpm --filter n8n-playwright test:local \
|
||||
pnpm --filter n8n-playwright test:container:standard \
|
||||
--workers=${{ env.PLAYWRIGHT_WORKERS }}
|
||||
env:
|
||||
BUILD_WITH_COVERAGE: 'true'
|
||||
@@ -40,11 +46,23 @@ jobs:
|
||||
QA_PERFORMANCE_METRICS_WEBHOOK_PASSWORD: ${{ secrets.QA_PERFORMANCE_METRICS_WEBHOOK_PASSWORD }}
|
||||
|
||||
- name: Generate Coverage Report
|
||||
if: always() && steps.coverage-tests.outcome != 'skipped'
|
||||
run: pnpm --filter n8n-playwright coverage:report
|
||||
|
||||
- name: Upload Coverage Report
|
||||
- name: Upload Coverage Report Artifact
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: coverage-report
|
||||
path: packages/testing/playwright/coverage/
|
||||
retention-days: 14
|
||||
|
||||
- name: Upload E2E Coverage to Codecov
|
||||
if: always()
|
||||
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: packages/testing/playwright/coverage/lcov.info
|
||||
flags: frontend-e2e
|
||||
name: playwright-e2e
|
||||
fail_ci_if_error: false
|
||||
|
||||
+9
-3
@@ -13,9 +13,15 @@ github_checks:
|
||||
annotations: false
|
||||
|
||||
flags:
|
||||
tests:
|
||||
paths:
|
||||
- '**'
|
||||
backend-unit:
|
||||
carryforward: true
|
||||
backend-integration:
|
||||
carryforward: true
|
||||
nodes-unit:
|
||||
carryforward: true
|
||||
frontend:
|
||||
carryforward: true
|
||||
frontend-e2e:
|
||||
carryforward: true
|
||||
|
||||
component_management:
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
"build:n8n": "node scripts/build-n8n.mjs",
|
||||
"build:deploy": "node scripts/build-n8n.mjs",
|
||||
"build:docker": "node scripts/build-n8n.mjs && node scripts/dockerize-n8n.mjs",
|
||||
"build:docker:coverage": "BUILD_WITH_COVERAGE=true node scripts/build-n8n.mjs && node scripts/dockerize-n8n.mjs",
|
||||
"build:docker:scan": "node scripts/build-n8n.mjs && node scripts/dockerize-n8n.mjs && node scripts/scan-n8n-image.mjs",
|
||||
"build:docker:test": "node scripts/build-n8n.mjs && node scripts/dockerize-n8n.mjs && turbo run test:container:standard --filter=n8n-playwright",
|
||||
"typecheck": "turbo typecheck",
|
||||
|
||||
@@ -34,18 +34,22 @@ function main() {
|
||||
const mergedFile = path.join(NYC_OUTPUT_DIR, 'out.json');
|
||||
execSync(`npx nyc merge ${UI_DIR} ${mergedFile}`, { stdio: 'inherit' });
|
||||
|
||||
// Generate HTML report
|
||||
console.log('Generating HTML report...');
|
||||
// Generate reports (HTML for viewing, LCOV for Codecov)
|
||||
console.log('Generating coverage reports...');
|
||||
execSync(
|
||||
`npx nyc report --reporter=html --report-dir=${COVERAGE_DIR} --temp-dir=${NYC_OUTPUT_DIR} --config=${NYC_CONFIG} --exclude-after-remap=false`,
|
||||
`npx nyc report --reporter=html --reporter=lcov --report-dir=${COVERAGE_DIR} --temp-dir=${NYC_OUTPUT_DIR} --config=${NYC_CONFIG} --exclude-after-remap=false`,
|
||||
{ stdio: 'inherit' },
|
||||
);
|
||||
|
||||
const htmlReportPath = path.join(COVERAGE_DIR, 'index.html');
|
||||
const lcovPath = path.join(COVERAGE_DIR, 'lcov.info');
|
||||
|
||||
console.log(`\n✅ Coverage reports generated successfully!`);
|
||||
if (fs.existsSync(htmlReportPath)) {
|
||||
console.log(`\n✅ Coverage report generated successfully!`);
|
||||
console.log(`📊 Report: ${htmlReportPath}`);
|
||||
console.log(`🌐 Open: file://${htmlReportPath}`);
|
||||
console.log(`📊 HTML Report: ${htmlReportPath}`);
|
||||
}
|
||||
if (fs.existsSync(lcovPath)) {
|
||||
console.log(`📄 LCOV Report: ${lcovPath} (for Codecov)`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('❌ Failed to generate coverage report:', error.message);
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"globalEnv": ["CI", "COVERAGE_ENABLED"],
|
||||
"globalEnv": ["CI", "COVERAGE_ENABLED", "BUILD_WITH_COVERAGE"],
|
||||
"tasks": {
|
||||
"clean": { "cache": false },
|
||||
"build": {
|
||||
|
||||
Reference in New Issue
Block a user