0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-04-07 23:41:43 -05:00
astro/benchmark/ci-helper.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
496 B
JavaScript
Raw Permalink Normal View History

// This script helps extract the benchmark logs that are between the `==========` lines.
// They are a convention defined in the `./bench/_template.js` file, which are used to log
// out with the `!bench` command. See `/.github/workflows/benchmark.yml` to see how it's used.
const benchLogs = process.argv[2];
const resultRegex = /==========(.*?)==========/gs;
let processedLog = '';
let m;
while ((m = resultRegex.exec(benchLogs))) {
processedLog += m[1] + '\n';
}
console.log(processedLog);