Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/initial execution suite #1

Merged
merged 28 commits into from Nov 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 17 additions & 17 deletions .github/workflows/benchmark-cli.yml
Expand Up @@ -9,10 +9,8 @@ jobs:

strategy:
matrix:
# os: [ubuntu-latest, macOS-latest]
os: [ubuntu-latest]
# node-version: [10.x, 12.x]
node-version: [10.x]
os: [ubuntu-latest, macOS-latest]
node-version: [10.x, 12.x]

runs-on: ${{ matrix.os }}

Expand All @@ -22,7 +20,7 @@ jobs:
uses: actions/checkout@v1.1.0
with:
path: ${{ env.RUNNER_WORKSPACE }}
# Checkout repo incoming dispatch request is from (npm/cli)
# Checkout repo incoming dispatch request is from (eg. npm/cli)
- name: checkout/${{ github.event.client_payload.owner }}/${{ github.event.client_payload.repo }}
uses: actions/checkout@v1.1.0
with:
Expand Down Expand Up @@ -73,10 +71,20 @@ jobs:
echo "Current Commit: $(git log --oneline -1)"

# Run benchmarking suite
- name: Run Benchmark
- name: Run Benchmark (Pull-Request)
if: github.event.action == 'pull_request'
run: |
echo "Running benchmark..."
echo "PWD: $(pwd)"
npm run benchmark:pr

# Run benchmarking suite
- name: Run Benchmark (Push)
if: github.event.action == 'push'
run: |
echo "Running benchmark..."
echo "PWD: $(pwd)"
npm run benchmark:release

# CONDITIONALLY: Post to pull-request
- name: Post to Pull-Request
Expand All @@ -86,7 +94,9 @@ jobs:
REPO: ${{ github.event.client_payload.repo }}
OWNER: ${{ github.event.client_payload.owner }}
GITHUB_TOKEN: ${{ github.token }}
run: echo "Posting to pull-request..."
run: |
echo "Posting to pull-request..."
npm run comment

# CONDITIONALLY: Commit results of benchmark suite into `npm/benchmark` repo
- name: Commit Results
Expand All @@ -111,13 +121,3 @@ jobs:
git commit -m "ci: updated results [CI/CD]"
git log --oneline -3
git push origin master

# TODO: remove this step
- name: Env
run: |
echo "GITHUB_WORKSPACE: ${GITHUB_WORKSPACE}"
echo "PWD: $(pwd)"
ls -al .
ls -al ..
echo "${{ toJson(github.event) }}"
printenv
48 changes: 48 additions & 0 deletions fixtures/angular-quickstart/package.json
@@ -0,0 +1,48 @@
{
"name": "angular-quickstart",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^5.2.0",
"@angular/common": "^5.2.0",
"@angular/compiler": "^5.2.0",
"@angular/core": "^5.2.0",
"@angular/forms": "^5.2.0",
"@angular/http": "^5.2.0",
"@angular/platform-browser": "^5.2.0",
"@angular/platform-browser-dynamic": "^5.2.0",
"@angular/router": "^5.2.0",
"core-js": "^2.4.1",
"rxjs": "^5.5.6",
"zone.js": "^0.8.19"
},
"devDependencies": {
"@angular/cli": "~1.7.0",
"@angular/compiler-cli": "^5.2.0",
"@angular/language-service": "^5.2.0",
"@types/jasmine": "~2.8.3",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "~2.5.3"
}
}
118 changes: 118 additions & 0 deletions fixtures/app-large/package.json
@@ -0,0 +1,118 @@
{
"name": "app-large",
"version": "0.0.1",
"dependencies": {
"animate.less": "^2.2.0",
"autoprefixer": "^6.0.3",
"babel-core": "^6.4.0",
"babel-eslint": "^6.1.2",
"babel-loader": "^6.2.1",
"babel-plugin-lodash": "^3.2.11",
"babel-plugin-module-resolver": "^2.2.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-runtime": "^6.4.3",
"babel-polyfill": "^6.23.0",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babel-preset-react-hmre": "^1.0.1",
"babel-preset-stage-1": "^6.3.13",
"babel-runtime": "^6.3.19",
"clean-webpack-plugin": "^0.1.16",
"core-decorators": "^0.12.3",
"css-loader": "^0.23.1",
"css-mqpacker": "^4.0.0",
"cssnano": "^3.2.0",
"custom-event-polyfill": "^0.2.2",
"draft-js": "^0.9.0",
"ejs": "^2.5.6",
"eslint": "^3.4.0",
"eslint-config-airbnb": "^11.0.0",
"eslint-import-resolver-webpack": "^0.5.1",
"eslint-plugin-import": "^1.14.0",
"eslint-plugin-jsx-a11y": "^2.2.1",
"eslint-plugin-react": "^6.2.0",
"express": "^4.15.2",
"express-http-proxy": "^0.11.0",
"font-awesome": "^4.7.0",
"fready": "^1.0.0",
"glob": "^7.1.1",
"gulp": "^3.9.0",
"gulp-concat": "^2.6.0",
"gulp-csslint": "^0.2.0",
"gulp-cssnano": "^2.0.0",
"gulp-eol": "^0.1.1",
"gulp-less": "^3.0.5",
"gulp-livereload": "^3.8.1",
"gulp-minify-css": "^1.2.3",
"gulp-postcss": "^6.0.1",
"gulp-rename": "^1.2.2",
"gulp-util": "^3.0.7",
"happypack": "^3.0.3",
"highcharts": "^5.0.10",
"highcharts-solid-gauge": "^0.1.2",
"history": "^4.6.1",
"howler": "^1.1.28",
"imports-loader": "^0.6.5",
"jquery": "^2.2.0",
"jquery-ui": "1.10.5",
"js-cookie": "^2.1.3",
"json-loader": "^0.5.4",
"leftpad": "^0.0.0",
"less": "^2.7.2",
"lesshat": "^3.0.2",
"lodash": "^3.0.0",
"medium-draft": "^0.4.1",
"mobx": "^3.1.8",
"mobx-react": "^4.1.5",
"moment": "^2.18.1",
"moment-range": "^2.0.3",
"moment-timezone": "^0.5.13",
"password-policy": "0.0.2",
"postcss-reporter": "^1.2.1",
"progress": "^2.0.0",
"qs": "^6.1.0",
"raw-loader": "^0.5.1",
"rc-slider": "^6.1.0",
"react": "^15.4.1",
"react-addons-css-transition-group": "^15.3.0",
"react-addons-shallow-compare": "^15.3.0",
"react-dnd": "^2.1.4",
"react-dnd-html5-backend": "^2.1.2",
"react-dom": "^15.4.1",
"react-draft-wysiwyg": "^1.6.5",
"react-dropzone": "^3.5.3",
"react-grid-layout": "^0.12.6",
"react-highcharts": "^11.5.0",
"react-hot-loader": "v3.0.0-beta.6",
"react-input-calendar": "^0.3.14",
"react-lazyload": "^2.2.5",
"react-measure": "^1.4.6",
"react-mixin": "^3.0.3",
"react-responsive": "^1.2.5",
"react-responsive-tabs": "^0.5.3",
"react-router": "^4.0.0",
"react-router-dom": "^4.0.0",
"react-select-plus": "^1.0.0-rc",
"react-skylight": "^0.3.0",
"react-sortablejs": "^1.2.1",
"react-tappable": "^0.8.4",
"react-tooltip": "^3.3.0",
"react-virtualized": "^7.19.4",
"react-waypoint": "^5.2.0",
"sortablejs": "^1.5.0-rc1",
"style-loader": "^0.13.0",
"stylelint": "^1.2.1",
"superagent": "^1.6.1",
"uglify-js": "^2.8.22",
"uuid": "^3.0.1",
"verge": "^1.9.1",
"webpack-bundle-analyzer": "^2.3.1",
"webpack-hot-middleware": "^2.18.0",
"webpack-notifier": "^1.5.0",
"webpack-split-by-path": "^2.0.0",
"whatwg-fetch": "^2.0.3"
},
"devDependencies": {
"nan-as": "^1.6.1"
}
}
63 changes: 63 additions & 0 deletions fixtures/app-medium/package.json
@@ -0,0 +1,63 @@
{
"name": "app-medium",
"version": "0.0.0",
"dependencies": {
"axios": "^0.16.0",
"emailjs": "^0.3.13",
"es6-promise": "^4.1.0",
"faker": "^3.1.0",
"js-beautify": "^1.6.14",
"json3": "^3.3.2",
"lodash": "^4.17.4",
"store2": "^2.5.0",
"vue": "^2.2.2",
"vue-axios": "^2.0.1",
"vue-my-dropdown": "^2.0.3",
"vue-resource": "^1.2.1",
"vue-select": "^2.1.0"
},
"devDependencies": {
"@corbinu/eslint-plugin-corbinu": "^2.0.0",
"autoprefixer": "^6.7.2",
"babel-core": "^6.22.1",
"babel-eslint": "^7.2.3",
"babel-loader": "^7.0.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-preset-env": "^1.2.1",
"babel-preset-es2015": "^6.24.0",
"babel-preset-stage-2": "^6.22.0",
"babel-register": "^6.22.0",
"chalk": "^1.1.3",
"connect-history-api-fallback": "^1.3.0",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0",
"eslint": "^3.14.1",
"eslint-friendly-formatter": "^2.0.7",
"eslint-loader": "^1.6.1",
"eslint-plugin-html": "^2.0.0",
"eventsource-polyfill": "^0.9.6",
"express": "^4.14.1",
"extract-text-webpack-plugin": "^2.0.0",
"file-loader": "^0.11.1",
"friendly-errors-webpack-plugin": "^1.1.3",
"function-bind": "^1.1.0",
"html-webpack-plugin": "^2.28.0",
"http-proxy-middleware": "^0.17.3",
"nyc": "^10.2.0",
"opn": "^4.0.2",
"optimize-css-assets-webpack-plugin": "^1.3.0",
"ora": "^1.1.0",
"rimraf": "^2.6.0",
"semver": "^5.3.0",
"typescript": "~2.2.0",
"url-loader": "^0.5.7",
"vue-loader": "^11.1.4",
"vue-style-loader": "^3.0.0",
"vue-template-compiler": "^2.2.1",
"webpack": "^2.2.1",
"webpack-bundle-analyzer": "^2.2.1",
"webpack-dev-middleware": "^1.10.2",
"webpack-hot-middleware": "^2.16.1",
"webpack-merge": "^4.0.0"
}
}
47 changes: 47 additions & 0 deletions fixtures/ember-quickstart/package.json
@@ -0,0 +1,47 @@
{
"name": "ember-quickstart",
"version": "0.0.0",
"private": true,
"description": "Small description for ember-quickstart goes here",
"license": "MIT",
"author": "",
"directories": {
"doc": "doc",
"test": "tests"
},
"repository": "",
"scripts": {
"build": "ember build",
"lint:js": "eslint ./*.js app config lib server tests",
"start": "ember serve",
"test": "ember test"
},
"devDependencies": {
"broccoli-asset-rev": "^2.4.5",
"ember-ajax": "^3.0.0",
"ember-cli": "~3.0.0",
"ember-cli-app-version": "^3.0.0",
"ember-cli-babel": "^6.6.0",
"ember-cli-dependency-checker": "^2.0.0",
"ember-cli-eslint": "^4.2.1",
"ember-cli-htmlbars": "^2.0.1",
"ember-cli-htmlbars-inline-precompile": "^1.0.0",
"ember-cli-inject-live-reload": "^1.4.1",
"ember-cli-qunit": "^4.1.1",
"ember-cli-shims": "^1.2.0",
"ember-cli-sri": "^2.1.0",
"ember-cli-uglify": "^2.0.0",
"ember-data": "~3.0.0",
"ember-export-application-global": "^2.0.0",
"ember-load-initializers": "^1.0.0",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-resolver": "^4.0.0",
"ember-source": "~3.0.0",
"ember-welcome-page": "^3.0.0",
"eslint-plugin-ember": "^5.0.0",
"loader.js": "^4.2.3"
},
"engines": {
"node": "^4.5 || 6.* || >= 7.*"
}
}
16 changes: 16 additions & 0 deletions fixtures/react-app/package.json
@@ -0,0 +1,16 @@
{
"name": "react-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-scripts": "1.1.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
27 changes: 27 additions & 0 deletions index.js
@@ -0,0 +1,27 @@
'use strict'

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

const args = process.argv.slice(2)
const command = args.length && args[0]
const isRelease = args.length && args[1]

log.verbose('ARGS:', args)
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.')
}