Skip to content

Commit

Permalink
add script to check modifications by action
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Nov 17, 2019
1 parent c262440 commit 616a5ef
Show file tree
Hide file tree
Showing 9 changed files with 328 additions and 11 deletions.
28 changes: 24 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ jobs:
${{ runner.os }}-node-
- run: npm install
- run: npm run build
- name: Save previous data.js
run: |
git checkout gh-pages
cp ./dev/bench/data.js before_data.js
git checkout -
- run: rustup toolchain update nightly && rustup default nightly
- name: Run benchmark
run: cd examples/rust && cargo +nightly bench | tee output.txt
Expand All @@ -25,7 +30,7 @@ jobs:
name: Rust Benchmark
tool: 'cargo'
output-file-path: examples/rust/output.txt
- run: echo 'TODO Verify result here!'
- run: node ./scripts/ci_validate_modification.js before_data.js 'Rust Benchmark'
go:
name: Run Go benchmark example
runs-on: ubuntu-latest
Expand All @@ -41,6 +46,11 @@ jobs:
${{ runner.os }}-node-
- run: npm install
- run: npm run build
- name: Save previous data.js
run: |
git checkout gh-pages
cp ./dev/bench/data.js before_data.js
git checkout -
- name: Run benchmark
run: cd examples/go && go test -bench 'BenchmarkFib' | tee output.txt
- name: Store benchmark result
Expand All @@ -49,7 +59,7 @@ jobs:
name: Go Benchmark
tool: 'go'
output-file-path: examples/go/output.txt
- run: echo 'TODO Verify result here!'
- run: node ./scripts/ci_validate_modification.js before_data.js 'Go Benchmark'
benchmarkjs:
name: Run JavaScript benchmark example
runs-on: ubuntu-latest
Expand All @@ -64,6 +74,11 @@ jobs:
${{ runner.os }}-node-
- run: npm install
- run: npm run build
- name: Save previous data.js
run: |
git checkout gh-pages
cp ./dev/bench/data.js before_data.js
git checkout -
- name: Run benchmark
run: cd examples/benchmarkjs && npm install && node bench.js | tee output.txt
- name: Store benchmark result
Expand All @@ -72,7 +87,7 @@ jobs:
name: Benchmark.js Benchmark
tool: 'benchmarkjs'
output-file-path: examples/benchmarkjs/output.txt
- run: echo 'TODO Verify result here!'
- run: node ./scripts/ci_validate_modification.js before_data.js 'Benchmark.js Benchmark'
pytest-benchmark:
name: Run Pytest benchmark example
runs-on: ubuntu-latest
Expand All @@ -88,6 +103,11 @@ jobs:
${{ runner.os }}-node-
- run: npm install
- run: npm run build
- name: Save previous data.js
run: |
git checkout gh-pages
cp ./dev/bench/data.js before_data.js
git checkout -
- name: Run benchmark
run: |
cd examples/pytest
Expand All @@ -99,7 +119,7 @@ jobs:
name: Python Benchmark with pytest-benchmark
tool: 'pytest'
output-file-path: examples/pytest/output.json
- run: echo 'TODO Verify result here!'
- run: node ./scripts/ci_validate_modification.js before_data.js 'Python Benchmark with pytest-benchmark'
unit-tests:
name: Run unit tests
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
/examples/rust/target
/test/*.js
/test/*.js.map
/scripts/*.js
/scripts/*.js.map
2 changes: 1 addition & 1 deletion config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface Config {
autoPush: boolean;
}

const VALID_TOOLS: ToolType[] = ['cargo', 'go', 'benchmarkjs', 'pytest'];
export const VALID_TOOLS: ToolType[] = ['cargo', 'go', 'benchmarkjs', 'pytest'];

function validateToolType(tool: string): asserts tool is ToolType {
if ((VALID_TOOLS as string[]).includes(tool)) {
Expand Down
53 changes: 53 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,17 @@
"devDependencies": {
"@types/acorn": "^4.0.5",
"@types/cheerio": "^0.22.13",
"@types/deep-diff": "^1.0.0",
"@types/deep-equal": "^1.0.1",
"@types/mocha": "^5.2.7",
"@types/mock-require": "^2.0.0",
"@types/node": "^12.12.7",
"@typescript-eslint/eslint-plugin": "^2.7.0",
"@typescript-eslint/parser": "^2.7.0",
"acorn": "^7.1.0",
"cheerio": "^1.0.0-rc.3",
"deep-diff": "^1.0.2",
"deep-equal": "^1.1.1",
"eslint": "^6.6.0",
"eslint-config-prettier": "^6.5.0",
"eslint-plugin-mocha": "^6.2.1",
Expand Down
Loading

0 comments on commit 616a5ef

Please sign in to comment.