From 67305d132bcfca329d69331b0655e0a63a36584b Mon Sep 17 00:00:00 2001 From: Tarrence van As Date: Wed, 24 Jan 2024 10:08:11 -0500 Subject: [PATCH] Enable benches in ci --- .github/workflows/bench.yml | 34 ++++++++++++++++++++++++++++++++++ .gitignore | 1 + 2 files changed, 35 insertions(+) create mode 100644 .github/workflows/bench.yml diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml new file mode 100644 index 0000000000..65811c0554 --- /dev/null +++ b/.github/workflows/bench.yml @@ -0,0 +1,34 @@ +name: benchmark + +on: + push: + branches: [main] + pull_request: + +permissions: + # deployments permission to deploy GitHub pages website + deployments: write + # contents permission to update benchmark contents in gh-pages branch + contents: write + +jobs: + build: + runs-on: ubuntu-latest + container: + image: ghcr.io/dojoengine/dojo-dev:136a67a + steps: + - uses: actions/checkout@v3 + - run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + - run: cargo bench --bench codec -- --output-format bencher |sed 1d | tee output.txt + - uses: benchmark-action/github-action-benchmark@v1 + with: + tool: "cargo" + output-file-path: output.txt + benchmark-data-dir-path: "." + # Access token to deploy GitHub Pages branch + github-token: ${{ secrets.GITHUB_TOKEN }} + # Push and deploy GitHub pages branch automatically + auto-push: true + alert-threshold: "130%" + comment-on-alert: true + alert-comment-cc-users: "@kariy,@glihm,@tarrencev" diff --git a/.gitignore b/.gitignore index 2f03a36f66..f4fb0462d7 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ dojo.iml .env data crates/benches/gas_usage.txt +output.txt