Skip to content

Commit

Permalink
feat: benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
L-Qun committed Jul 13, 2024
1 parent a70ee95 commit de7d926
Showing 1 changed file with 14 additions and 30 deletions.
44 changes: 14 additions & 30 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Benchmark
name: Benchmarks

on:
push:
Expand All @@ -7,35 +7,24 @@ on:
types: [opened, synchronize]

permissions:
pull-requests: write
issues: write

jobs:
benchmarks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v2
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node
uses: actions/setup-node@v4
version: 8.2.0
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline

- name: Run benchmarks
run: pnpm run benchmarks

- name: Generate Markdown Table
id: generate_table
run: |
node-version: 18
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- run: pnpm install --frozen-lockfile
- run: pnpm run benchmarks
- run: |
FILES=("benchmarks/simple-read.json" "benchmarks/simple-write.json" "benchmarks/subscribe-write.json")
echo "## Benchmark Results" > table.md
for file in "${FILES[@]}"; do
Expand All @@ -49,17 +38,12 @@ jobs:
fi
done
cat table.md
- name: Read table.md
id: read_table
run: |
- run: |
table_content=$(cat table.md)
echo "table_content<<EOF" >> $GITHUB_ENV
echo "$table_content" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create Comment
uses: peter-evans/create-or-update-comment@v2
- uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.pull_request.number }}
body: ${{ env.table_content }}

0 comments on commit de7d926

Please sign in to comment.