migrate 'main' tests to GH actions (#8332)

* implement 'main' tests using GH actions

* remove 'main' builds from Circle CI config

* give jobs better names
This commit is contained in:
chris48s
2022-08-25 18:02:03 +01:00
committed by GitHub
parent 08af9eadbd
commit acf189eaf7
7 changed files with 152 additions and 70 deletions

36
scripts/mocha2md.js Normal file
View File

@@ -0,0 +1,36 @@
import fs from 'fs'
let data
let title
try {
if (process.argv.length < 4) {
throw new Error()
}
title = process.argv[2]
data = JSON.parse(fs.readFileSync(process.argv[3]))
} catch (e) {
process.stdout.write('failed to write summary\n')
process.exit(1)
}
process.stdout.write(`# ${title}\n\n`)
if (data.stats.passes > 0) {
process.stdout.write(`${data.stats.passes} passed\n`)
}
if (data.stats.failures > 0) {
process.stdout.write(`${data.stats.failures} failed\n\n`)
}
if (data.stats.failures > 0) {
for (const test of data.tests) {
if (test.err && Object.keys(test.err).length > 0) {
process.stdout.write(`### ${test.title}\n\n`)
process.stdout.write(`${test.fullTitle}\n\n`)
process.stdout.write('```\n')
process.stdout.write(`${test.err.stack}\n`)
process.stdout.write('```\n\n')
}
}
}