-
-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3f73b9
commit 9dc8d90
Showing
7 changed files
with
106 additions
and
864 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Node benchmarks | ||
|
||
on: | ||
schedule: | ||
# * is a special character in YAML so you have to quote this string | ||
- cron: '0 0 1 * *' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 10 | ||
- name: benchmarks | ||
run: | | ||
npm install | ||
npm start y 100 10 40 | ||
node_version=$(node --version) | ||
benchmark_title=$(cat << EOF | ||
# Benchmarks | ||
* __Machine:__ $(uname -a) | $(node -r os -p "\`\${os.cpus().length} vCPUs | \${Math.ceil(os.totalmem() / (Math.pow(1024, 3)))}GB\`"). | ||
* __Method:__ \`autocannon -c 100 -d 40 -p 10 localhost:3000\` (two rounds; one to warm-up, one to measure). | ||
* __Node:__ \`$node_version\` | ||
* __Run:__ $(date) | ||
EOF) | ||
benchmark_table=$(node benchmark-compare.js -t -c) | ||
strip_readme=$(node -r fs -p 'fs.readFileSync("./README.md", "utf-8").split(/# Benchmarks/)[0]') | ||
git checkout master | ||
echo -e "${strip_readme:?}\n${benchmark_title:?}\n\n${benchmark_table}" > README.md | ||
git add README.md | ||
git config user.name 'Github Actions' | ||
git config user.email '<>' | ||
git commit -m "Add new benchmarks to README.md" | ||
git remote set-url --push origin https://${{ secrets.GITHUB_USERNAME }}:${{ secrets.GITHUB_REPO_TOKEN }}@github.com/fastify/benchmarks | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,4 +56,3 @@ yarn.lock | |
package-lock.json | ||
|
||
# benchmark results | ||
results |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.