Skip to content

chore: set up code formatter #61

chore: set up code formatter

chore: set up code formatter #61

Workflow file for this run

name: Comment Benchmarks
on:
pull_request:
branches:
- main
jobs:
benchmark:
runs-on: ubuntu-24.04
name: Run Benchmarks and Comment
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: oven-sh/setup-bun@v1
with:
bun-version: 1.2.17
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
cache: "npm"
- name: Install dfx
uses: dfinity/setup-dfx@main
- name: Confirm successful installation
run: dfx --version
- name: Install dfx cache
run: dfx cache install
- name: Cache mops packages
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
key: mops-packages-${{ hashFiles('mops.toml') }}
restore-keys: |
mops-packages-${{ hashFiles('mops.toml') }}
mops-packages-
path: |
~/.cache/mops
- name: Install npm packages
run: cd cli && npm install
- name: Build local cli
run: cd cli && npm run prepare
- name: Install mops
run: npm i -g ./cli/dist
- name: Install mops packages
run: mops install
- name: Benchmarks
id: benchmarks
run: |
mops bench --compare 2>&1 | tee benchmark_results.txt
echo "result<<EOF" >> $GITHUB_OUTPUT
cat benchmark_results.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Find Comment
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.1.0
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
body-includes: Benchmark Results
- name: Create or update comment
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: ${{ steps.benchmarks.outputs.result }}
edit-mode: replace