From a7cad514e1a0cdb16f1f28e9412aa95da7af75a4 Mon Sep 17 00:00:00 2001 From: Connor Burton Date: Sun, 17 Sep 2023 13:50:46 +0100 Subject: [PATCH 1/4] ci: fix benchmark tool, create new shell script to compile, run and tear down --- .gitignore | 4 ++-- benchmark/tsconfig.json | 7 +++++++ package.json | 4 ++-- scripts/run-benchmark.sh | 8 ++++++++ 4 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 benchmark/tsconfig.json create mode 100644 scripts/run-benchmark.sh diff --git a/.gitignore b/.gitignore index 06c0b84..fec1ca3 100644 --- a/.gitignore +++ b/.gitignore @@ -23,5 +23,5 @@ node_modules/ # dist /dist -benchmark/*.js -tests/compiled \ No newline at end of file +tests/compiled +benchmark/compiled \ No newline at end of file diff --git a/benchmark/tsconfig.json b/benchmark/tsconfig.json new file mode 100644 index 0000000..b21de4d --- /dev/null +++ b/benchmark/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../tsconfig.json", + "include": ["**/*"], + "compilerOptions": { + "outDir": "./compiled" + } +} diff --git a/package.json b/package.json index adfdebd..7c42f32 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "style:check": "yarn prettier . --check", "style:fix": "yarn prettier . --write", "test": "./scripts/run-tests.sh", - "benchmark": "ts-node ./benchmark/index.ts" + "benchmark": "./scripts/run-benchmark.sh" }, "repository": { "type": "git", @@ -84,4 +84,4 @@ "peerDependencies": { "express": "^4.0.0" } -} +} \ No newline at end of file diff --git a/scripts/run-benchmark.sh b/scripts/run-benchmark.sh new file mode 100644 index 0000000..43106d5 --- /dev/null +++ b/scripts/run-benchmark.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -e + +trap "rm -rf ./benchmark/compiled" EXIT + +yarn tsc --project benchmark +node ./benchmark/compiled/benchmark/index.js \ No newline at end of file From cc4570214ccf80e3e66b8025f4964e298d8373f7 Mon Sep 17 00:00:00 2001 From: Connor Burton Date: Sun, 17 Sep 2023 13:51:52 +0100 Subject: [PATCH 2/4] ci: add benchmark ci stage --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2985dbd..11b0903 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,8 @@ jobs: run: yarn lint:check - name: Check Coding Style run: yarn style:check + - name: Run benchmark + run: yarn benchmark - name: Test with Coverage run: | # Check coverage, if coverage is below 100% for any files exit & print a message From 62131c376f0784291a6a0064f62f38abea0c7f5e Mon Sep 17 00:00:00 2001 From: Connor Burton Date: Sun, 17 Sep 2023 13:53:08 +0100 Subject: [PATCH 3/4] style: package.json prettier style --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7c42f32..2925da7 100644 --- a/package.json +++ b/package.json @@ -84,4 +84,4 @@ "peerDependencies": { "express": "^4.0.0" } -} \ No newline at end of file +} From c30e442f1c26aa2bbe0a38ae5f17a77830b567f5 Mon Sep 17 00:00:00 2001 From: Connor Burton Date: Sun, 17 Sep 2023 13:54:08 +0100 Subject: [PATCH 4/4] ci: make run-benchmark executable --- scripts/run-benchmark.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/run-benchmark.sh diff --git a/scripts/run-benchmark.sh b/scripts/run-benchmark.sh old mode 100644 new mode 100755