ci-helper.js 496 B

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