Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
989ddd2
chore: added package files
Nov 6, 2019
050e625
feat: added fixture data
Nov 6, 2019
440d567
feat: added initial 'base' (not real) results
Nov 6, 2019
33872ba
feat: added constants file
Nov 6, 2019
7d78ca6
feat: added npm command benchmark suite
Nov 6, 2019
3252e76
feat: added suite actions/helpers
Nov 6, 2019
756bd1d
feat: added common utils
Nov 6, 2019
9e81436
feat: added execution function
Nov 6, 2019
dca32ff
feat: added repo entrypoint
Nov 6, 2019
3436369
feat: added dedent, and octokit as deps
Nov 6, 2019
ad5faf9
feat: updated scripts in package file
Nov 6, 2019
cf7ba3d
feat: updated index to accempt command name; updated logging
Nov 6, 2019
8aaa278
feat: updated benchmark execution to handle writing multiple files; k…
Nov 6, 2019
e7ba5d4
feat: updated workflow handle two kinds of benchmarking scenarios
Nov 6, 2019
2f49fd5
feat: added comment function; added result parsing function
Nov 6, 2019
111b2db
chore: cleaned up logging
Nov 6, 2019
39c555a
feat: added pretty-ms dep for output to pull-requests
Nov 6, 2019
9c193b0
feat: updated result parsing logic
Nov 6, 2019
d3ac251
feat: updated results (from local machine; starting point)
Nov 6, 2019
6b4744d
fix: updated matrix in workflow
Nov 7, 2019
1036c66
chore: updated comment explaination
Nov 7, 2019
e1a2acf
fix: removed step used only for testing
Nov 7, 2019
84d3b30
fix: updated logging in utils file
Nov 7, 2019
8790f7e
fix: updated pull-request comment format to have a status emoji
Nov 7, 2019
7e3362a
chore: add todo about benchmark v2
Nov 7, 2019
4cbfb3b
chore: add todo/note about future fix
Nov 7, 2019
5b7643a
chore: add todo about future improvement
Nov 7, 2019
fb75d36
chore: add throw in catch block of execute; fix for loop
Nov 7, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: updated index to accempt command name; updated logging
  • Loading branch information
Michael Perrotte committed Nov 6, 2019
commit cf7ba3d9c19b1f0c224e80d5a47ef05c53ad47df
25 changes: 18 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
'use strict'

const comment = require('./lib/comment')
const execute = require('./lib/execute')
const { log } = require('./lib/utils')

// INFO: can potentially pass in command line arguments
const args = process.argv.slice(2)
const latest = (args.length && args[0] === 'latest')
const command = args.length && args[0]
const isRelease = args.length && args[1]

log.verbose('ARGS:', args)
if (latest) {
log.info('Executing benchmark against latest release')
} else {
log.info('Executing benchmark against a version')
const { PR_ID, REPO, OWNER } = process.env

switch (command) {
case 'benchmark':
log.info('Executing benchmark against latest release')
execute(!!isRelease)
break
case 'comment':
// TODO: bail out if we don't have correct environment variables
log.info(`Posting Comment to ${OWNER}/${REPO}/pulls/${PR_ID}`)
comment()
break
default:
log.error('Invalid argument supplied...')
log.error('Please use the npm-scripts.')
}
execute(latest)