Skip to content

Commit 8667f29

Browse files
committed
devops: simplify upload to flakiness.io
1 parent 2754ad5 commit 8667f29

1 file changed

Lines changed: 1 addition & 50 deletions

File tree

.github/workflows/flakiness-upload.yml

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -50,54 +50,5 @@ jobs:
5050
env:
5151
FLAKINESS_ACCESS_TOKEN: ${{ secrets.FLAKINESS_ACCESS_TOKEN }}
5252
run: |
53-
# Install the flakiness SDK
54-
npm install @flakiness/sdk
53+
find . -name report.json -exec npx -y flakiness upload {} +
5554
56-
# Upload each shard's report
57-
node --input-type=module << 'EOF'
58-
import { readReport, uploadReport } from '@flakiness/sdk';
59-
import fs from 'fs';
60-
import path from 'path';
61-
62-
const reportsBaseDir = 'flakiness-reports';
63-
64-
// Each artifact is downloaded to its own subdirectory
65-
// e.g., flakiness-reports/flakiness-report-macos-shard-1/report.json
66-
const shardDirs = fs.readdirSync(reportsBaseDir).filter(name =>
67-
fs.statSync(path.join(reportsBaseDir, name)).isDirectory()
68-
);
69-
70-
if (shardDirs.length === 0) {
71-
console.log('No flakiness report directories found');
72-
process.exit(0);
73-
}
74-
75-
console.log(`Found ${shardDirs.length} shard report(s):`, shardDirs);
76-
77-
for (const shardDir of shardDirs) {
78-
const reportDir = path.join(reportsBaseDir, shardDir);
79-
const reportJsonPath = path.join(reportDir, 'report.json');
80-
81-
if (!fs.existsSync(reportJsonPath)) {
82-
console.log(`Skipping ${shardDir}: no report.json found`);
83-
continue;
84-
}
85-
86-
console.log(`\nUploading flakiness report from: ${reportDir}`);
87-
try {
88-
const { report, attachments, missingAttachments } = await readReport(reportDir);
89-
90-
if (missingAttachments.length > 0) {
91-
console.warn('Missing attachments:', missingAttachments.map(a => a.id));
92-
}
93-
94-
const result = await uploadReport(report, attachments, {
95-
flakinessEndpoint: 'https://flakiness.io'
96-
});
97-
98-
console.log('Upload result:', result);
99-
} catch (error) {
100-
console.error(`Failed to upload ${shardDir}:`, error.message);
101-
}
102-
}
103-
EOF

0 commit comments

Comments
 (0)