Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit e8e454b

Browse files
author
Michael 'afrolion' Perrotte
authored
feature/initial-execution-suite (#1)
* chore: added package files * feat: added fixture data * feat: added initial 'base' (not real) results * feat: added constants file * feat: added npm command benchmark suite * feat: added suite actions/helpers * feat: added common utils * feat: added execution function * feat: added repo entrypoint * feat: added dedent, and octokit as deps * feat: updated scripts in package file * feat: updated index to accempt command name; updated logging * feat: updated benchmark execution to handle writing multiple files; keep latest.json up-to-date * feat: updated workflow handle two kinds of benchmarking scenarios * feat: added comment function; added result parsing function * chore: cleaned up logging * feat: added pretty-ms dep for output to pull-requests * feat: updated result parsing logic * feat: updated results (from local machine; starting * fix: updated matrix in * chore: updated comment * fix: removed step used only for * fix: updated logging in utils * fix: updated pull-request comment format to have a status * chore: add todo about benchmark v2 * chore: add todo/note about future fix * chore: add todo about future improvement * chore: add throw in catch block of execute; fix for loop
1 parent 952d3cc commit e8e454b

19 files changed

Lines changed: 1158 additions & 19 deletions

File tree

.github/workflows/benchmark-cli.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ jobs:
99

1010
strategy:
1111
matrix:
12-
# os: [ubuntu-latest, macOS-latest]
13-
os: [ubuntu-latest]
14-
# node-version: [10.x, 12.x]
15-
node-version: [10.x]
12+
os: [ubuntu-latest, macOS-latest]
13+
node-version: [10.x, 12.x]
1614

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

@@ -22,7 +20,7 @@ jobs:
2220
uses: actions/checkout@v1.1.0
2321
with:
2422
path: ${{ env.RUNNER_WORKSPACE }}
25-
# Checkout repo incoming dispatch request is from (npm/cli)
23+
# Checkout repo incoming dispatch request is from (eg. npm/cli)
2624
- name: checkout/${{ github.event.client_payload.owner }}/${{ github.event.client_payload.repo }}
2725
uses: actions/checkout@v1.1.0
2826
with:
@@ -73,10 +71,20 @@ jobs:
7371
echo "Current Commit: $(git log --oneline -1)"
7472
7573
# Run benchmarking suite
76-
- name: Run Benchmark
74+
- name: Run Benchmark (Pull-Request)
75+
if: github.event.action == 'pull_request'
76+
run: |
77+
echo "Running benchmark..."
78+
echo "PWD: $(pwd)"
79+
npm run benchmark:pr
80+
81+
# Run benchmarking suite
82+
- name: Run Benchmark (Push)
83+
if: github.event.action == 'push'
7784
run: |
7885
echo "Running benchmark..."
7986
echo "PWD: $(pwd)"
87+
npm run benchmark:release
8088
8189
# CONDITIONALLY: Post to pull-request
8290
- name: Post to Pull-Request
@@ -86,7 +94,9 @@ jobs:
8694
REPO: ${{ github.event.client_payload.repo }}
8795
OWNER: ${{ github.event.client_payload.owner }}
8896
GITHUB_TOKEN: ${{ github.token }}
89-
run: echo "Posting to pull-request..."
97+
run: |
98+
echo "Posting to pull-request..."
99+
npm run comment
90100
91101
# CONDITIONALLY: Commit results of benchmark suite into `npm/benchmark` repo
92102
- name: Commit Results
@@ -111,13 +121,3 @@ jobs:
111121
git commit -m "ci: updated results [CI/CD]"
112122
git log --oneline -3
113123
git push origin master
114-
115-
# TODO: remove this step
116-
- name: Env
117-
run: |
118-
echo "GITHUB_WORKSPACE: ${GITHUB_WORKSPACE}"
119-
echo "PWD: $(pwd)"
120-
ls -al .
121-
ls -al ..
122-
echo "${{ toJson(github.event) }}"
123-
printenv
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"name": "angular-quickstart",
3+
"version": "0.0.0",
4+
"license": "MIT",
5+
"scripts": {
6+
"ng": "ng",
7+
"start": "ng serve",
8+
"build": "ng build --prod",
9+
"test": "ng test",
10+
"lint": "ng lint",
11+
"e2e": "ng e2e"
12+
},
13+
"private": true,
14+
"dependencies": {
15+
"@angular/animations": "^5.2.0",
16+
"@angular/common": "^5.2.0",
17+
"@angular/compiler": "^5.2.0",
18+
"@angular/core": "^5.2.0",
19+
"@angular/forms": "^5.2.0",
20+
"@angular/http": "^5.2.0",
21+
"@angular/platform-browser": "^5.2.0",
22+
"@angular/platform-browser-dynamic": "^5.2.0",
23+
"@angular/router": "^5.2.0",
24+
"core-js": "^2.4.1",
25+
"rxjs": "^5.5.6",
26+
"zone.js": "^0.8.19"
27+
},
28+
"devDependencies": {
29+
"@angular/cli": "~1.7.0",
30+
"@angular/compiler-cli": "^5.2.0",
31+
"@angular/language-service": "^5.2.0",
32+
"@types/jasmine": "~2.8.3",
33+
"@types/jasminewd2": "~2.0.2",
34+
"@types/node": "~6.0.60",
35+
"codelyzer": "^4.0.1",
36+
"jasmine-core": "~2.8.0",
37+
"jasmine-spec-reporter": "~4.2.1",
38+
"karma": "~2.0.0",
39+
"karma-chrome-launcher": "~2.2.0",
40+
"karma-coverage-istanbul-reporter": "^1.2.1",
41+
"karma-jasmine": "~1.1.0",
42+
"karma-jasmine-html-reporter": "^0.2.2",
43+
"protractor": "~5.1.2",
44+
"ts-node": "~4.1.0",
45+
"tslint": "~5.9.1",
46+
"typescript": "~2.5.3"
47+
}
48+
}

fixtures/app-large/package.json

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
{
2+
"name": "app-large",
3+
"version": "0.0.1",
4+
"dependencies": {
5+
"animate.less": "^2.2.0",
6+
"autoprefixer": "^6.0.3",
7+
"babel-core": "^6.4.0",
8+
"babel-eslint": "^6.1.2",
9+
"babel-loader": "^6.2.1",
10+
"babel-plugin-lodash": "^3.2.11",
11+
"babel-plugin-module-resolver": "^2.2.0",
12+
"babel-plugin-transform-decorators-legacy": "^1.3.4",
13+
"babel-plugin-transform-runtime": "^6.4.3",
14+
"babel-polyfill": "^6.23.0",
15+
"babel-preset-es2015": "^6.3.13",
16+
"babel-preset-react": "^6.3.13",
17+
"babel-preset-react-hmre": "^1.0.1",
18+
"babel-preset-stage-1": "^6.3.13",
19+
"babel-runtime": "^6.3.19",
20+
"clean-webpack-plugin": "^0.1.16",
21+
"core-decorators": "^0.12.3",
22+
"css-loader": "^0.23.1",
23+
"css-mqpacker": "^4.0.0",
24+
"cssnano": "^3.2.0",
25+
"custom-event-polyfill": "^0.2.2",
26+
"draft-js": "^0.9.0",
27+
"ejs": "^2.5.6",
28+
"eslint": "^3.4.0",
29+
"eslint-config-airbnb": "^11.0.0",
30+
"eslint-import-resolver-webpack": "^0.5.1",
31+
"eslint-plugin-import": "^1.14.0",
32+
"eslint-plugin-jsx-a11y": "^2.2.1",
33+
"eslint-plugin-react": "^6.2.0",
34+
"express": "^4.15.2",
35+
"express-http-proxy": "^0.11.0",
36+
"font-awesome": "^4.7.0",
37+
"fready": "^1.0.0",
38+
"glob": "^7.1.1",
39+
"gulp": "^3.9.0",
40+
"gulp-concat": "^2.6.0",
41+
"gulp-csslint": "^0.2.0",
42+
"gulp-cssnano": "^2.0.0",
43+
"gulp-eol": "^0.1.1",
44+
"gulp-less": "^3.0.5",
45+
"gulp-livereload": "^3.8.1",
46+
"gulp-minify-css": "^1.2.3",
47+
"gulp-postcss": "^6.0.1",
48+
"gulp-rename": "^1.2.2",
49+
"gulp-util": "^3.0.7",
50+
"happypack": "^3.0.3",
51+
"highcharts": "^5.0.10",
52+
"highcharts-solid-gauge": "^0.1.2",
53+
"history": "^4.6.1",
54+
"howler": "^1.1.28",
55+
"imports-loader": "^0.6.5",
56+
"jquery": "^2.2.0",
57+
"jquery-ui": "1.10.5",
58+
"js-cookie": "^2.1.3",
59+
"json-loader": "^0.5.4",
60+
"leftpad": "^0.0.0",
61+
"less": "^2.7.2",
62+
"lesshat": "^3.0.2",
63+
"lodash": "^3.0.0",
64+
"medium-draft": "^0.4.1",
65+
"mobx": "^3.1.8",
66+
"mobx-react": "^4.1.5",
67+
"moment": "^2.18.1",
68+
"moment-range": "^2.0.3",
69+
"moment-timezone": "^0.5.13",
70+
"password-policy": "0.0.2",
71+
"postcss-reporter": "^1.2.1",
72+
"progress": "^2.0.0",
73+
"qs": "^6.1.0",
74+
"raw-loader": "^0.5.1",
75+
"rc-slider": "^6.1.0",
76+
"react": "^15.4.1",
77+
"react-addons-css-transition-group": "^15.3.0",
78+
"react-addons-shallow-compare": "^15.3.0",
79+
"react-dnd": "^2.1.4",
80+
"react-dnd-html5-backend": "^2.1.2",
81+
"react-dom": "^15.4.1",
82+
"react-draft-wysiwyg": "^1.6.5",
83+
"react-dropzone": "^3.5.3",
84+
"react-grid-layout": "^0.12.6",
85+
"react-highcharts": "^11.5.0",
86+
"react-hot-loader": "v3.0.0-beta.6",
87+
"react-input-calendar": "^0.3.14",
88+
"react-lazyload": "^2.2.5",
89+
"react-measure": "^1.4.6",
90+
"react-mixin": "^3.0.3",
91+
"react-responsive": "^1.2.5",
92+
"react-responsive-tabs": "^0.5.3",
93+
"react-router": "^4.0.0",
94+
"react-router-dom": "^4.0.0",
95+
"react-select-plus": "^1.0.0-rc",
96+
"react-skylight": "^0.3.0",
97+
"react-sortablejs": "^1.2.1",
98+
"react-tappable": "^0.8.4",
99+
"react-tooltip": "^3.3.0",
100+
"react-virtualized": "^7.19.4",
101+
"react-waypoint": "^5.2.0",
102+
"sortablejs": "^1.5.0-rc1",
103+
"style-loader": "^0.13.0",
104+
"stylelint": "^1.2.1",
105+
"superagent": "^1.6.1",
106+
"uglify-js": "^2.8.22",
107+
"uuid": "^3.0.1",
108+
"verge": "^1.9.1",
109+
"webpack-bundle-analyzer": "^2.3.1",
110+
"webpack-hot-middleware": "^2.18.0",
111+
"webpack-notifier": "^1.5.0",
112+
"webpack-split-by-path": "^2.0.0",
113+
"whatwg-fetch": "^2.0.3"
114+
},
115+
"devDependencies": {
116+
"nan-as": "^1.6.1"
117+
}
118+
}

fixtures/app-medium/package.json

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"name": "app-medium",
3+
"version": "0.0.0",
4+
"dependencies": {
5+
"axios": "^0.16.0",
6+
"emailjs": "^0.3.13",
7+
"es6-promise": "^4.1.0",
8+
"faker": "^3.1.0",
9+
"js-beautify": "^1.6.14",
10+
"json3": "^3.3.2",
11+
"lodash": "^4.17.4",
12+
"store2": "^2.5.0",
13+
"vue": "^2.2.2",
14+
"vue-axios": "^2.0.1",
15+
"vue-my-dropdown": "^2.0.3",
16+
"vue-resource": "^1.2.1",
17+
"vue-select": "^2.1.0"
18+
},
19+
"devDependencies": {
20+
"@corbinu/eslint-plugin-corbinu": "^2.0.0",
21+
"autoprefixer": "^6.7.2",
22+
"babel-core": "^6.22.1",
23+
"babel-eslint": "^7.2.3",
24+
"babel-loader": "^7.0.0",
25+
"babel-plugin-transform-runtime": "^6.22.0",
26+
"babel-preset-env": "^1.2.1",
27+
"babel-preset-es2015": "^6.24.0",
28+
"babel-preset-stage-2": "^6.22.0",
29+
"babel-register": "^6.22.0",
30+
"chalk": "^1.1.3",
31+
"connect-history-api-fallback": "^1.3.0",
32+
"copy-webpack-plugin": "^4.0.1",
33+
"css-loader": "^0.28.0",
34+
"eslint": "^3.14.1",
35+
"eslint-friendly-formatter": "^2.0.7",
36+
"eslint-loader": "^1.6.1",
37+
"eslint-plugin-html": "^2.0.0",
38+
"eventsource-polyfill": "^0.9.6",
39+
"express": "^4.14.1",
40+
"extract-text-webpack-plugin": "^2.0.0",
41+
"file-loader": "^0.11.1",
42+
"friendly-errors-webpack-plugin": "^1.1.3",
43+
"function-bind": "^1.1.0",
44+
"html-webpack-plugin": "^2.28.0",
45+
"http-proxy-middleware": "^0.17.3",
46+
"nyc": "^10.2.0",
47+
"opn": "^4.0.2",
48+
"optimize-css-assets-webpack-plugin": "^1.3.0",
49+
"ora": "^1.1.0",
50+
"rimraf": "^2.6.0",
51+
"semver": "^5.3.0",
52+
"typescript": "~2.2.0",
53+
"url-loader": "^0.5.7",
54+
"vue-loader": "^11.1.4",
55+
"vue-style-loader": "^3.0.0",
56+
"vue-template-compiler": "^2.2.1",
57+
"webpack": "^2.2.1",
58+
"webpack-bundle-analyzer": "^2.2.1",
59+
"webpack-dev-middleware": "^1.10.2",
60+
"webpack-hot-middleware": "^2.16.1",
61+
"webpack-merge": "^4.0.0"
62+
}
63+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"name": "ember-quickstart",
3+
"version": "0.0.0",
4+
"private": true,
5+
"description": "Small description for ember-quickstart goes here",
6+
"license": "MIT",
7+
"author": "",
8+
"directories": {
9+
"doc": "doc",
10+
"test": "tests"
11+
},
12+
"repository": "",
13+
"scripts": {
14+
"build": "ember build",
15+
"lint:js": "eslint ./*.js app config lib server tests",
16+
"start": "ember serve",
17+
"test": "ember test"
18+
},
19+
"devDependencies": {
20+
"broccoli-asset-rev": "^2.4.5",
21+
"ember-ajax": "^3.0.0",
22+
"ember-cli": "~3.0.0",
23+
"ember-cli-app-version": "^3.0.0",
24+
"ember-cli-babel": "^6.6.0",
25+
"ember-cli-dependency-checker": "^2.0.0",
26+
"ember-cli-eslint": "^4.2.1",
27+
"ember-cli-htmlbars": "^2.0.1",
28+
"ember-cli-htmlbars-inline-precompile": "^1.0.0",
29+
"ember-cli-inject-live-reload": "^1.4.1",
30+
"ember-cli-qunit": "^4.1.1",
31+
"ember-cli-shims": "^1.2.0",
32+
"ember-cli-sri": "^2.1.0",
33+
"ember-cli-uglify": "^2.0.0",
34+
"ember-data": "~3.0.0",
35+
"ember-export-application-global": "^2.0.0",
36+
"ember-load-initializers": "^1.0.0",
37+
"ember-maybe-import-regenerator": "^0.1.6",
38+
"ember-resolver": "^4.0.0",
39+
"ember-source": "~3.0.0",
40+
"ember-welcome-page": "^3.0.0",
41+
"eslint-plugin-ember": "^5.0.0",
42+
"loader.js": "^4.2.3"
43+
},
44+
"engines": {
45+
"node": "^4.5 || 6.* || >= 7.*"
46+
}
47+
}

fixtures/react-app/package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "react-app",
3+
"version": "0.1.0",
4+
"private": true,
5+
"dependencies": {
6+
"react": "^16.2.0",
7+
"react-dom": "^16.2.0",
8+
"react-scripts": "1.1.1"
9+
},
10+
"scripts": {
11+
"start": "react-scripts start",
12+
"build": "react-scripts build",
13+
"test": "react-scripts test --env=jsdom",
14+
"eject": "react-scripts eject"
15+
}
16+
}

index.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
'use strict'
2+
3+
const comment = require('./lib/comment')
4+
const execute = require('./lib/execute')
5+
const { log } = require('./lib/utils')
6+
7+
const args = process.argv.slice(2)
8+
const command = args.length && args[0]
9+
const isRelease = args.length && args[1]
10+
11+
log.verbose('ARGS:', args)
12+
const { PR_ID, REPO, OWNER } = process.env
13+
14+
switch (command) {
15+
case 'benchmark':
16+
log.info('Executing benchmark against latest release')
17+
execute(!!isRelease)
18+
break
19+
case 'comment':
20+
// TODO: bail out if we don't have correct environment variables
21+
log.info(`Posting Comment to ${OWNER}/${REPO}/pulls/${PR_ID}`)
22+
comment()
23+
break
24+
default:
25+
log.error('Invalid argument supplied...')
26+
log.error('Please use the npm-scripts.')
27+
}

0 commit comments

Comments
 (0)