refactor: rm infra folder from the main repo (#828) #104
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
name: Benchmark | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: [main] | |
paths-ignore: | |
- ".github/**" | |
- "docs/**" | |
- "examples/**" | |
- ".*" | |
- "README.md" | |
pull_request: | |
branches: [main] | |
paths-ignore: | |
- ".github/**" | |
- "docs/**" | |
- "examples/**" | |
- ".*" | |
- "README.md" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
permissions: | |
# deployments permission to deploy GitHub pages website | |
deployments: write | |
# contents permission to update benchmark contents in gh-pages branch | |
contents: write | |
# post on the pull-request page | |
pull-requests: write | |
jobs: | |
benchmark: | |
runs-on: [self-hosted, linux, benchmark] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
clean: false | |
- name: Build tests and install benchmark projects | |
run: |- | |
cd tests | |
npm clean-install | |
npm run build | |
cd ../benchmarking | |
npm i | |
- name: Build madara in release mode | |
run: cargo build --profile production -p madara | |
- name: Run benchmark | |
run: | | |
cd benchmarking | |
npm run test:ci | |
- name: Compare result | |
uses: benchmark-action/github-action-benchmark@v1 | |
with: | |
tool: "customBiggerIsBetter" | |
output-file-path: ./benchmarking/reports/metrics.json | |
alert-threshold: "120%" | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
fail-on-alert: true | |
summary-always: ${{ github.ref == 'refs/heads/main' }} | |
comment-always: false | |
comment-on-alert: false | |
auto-push: ${{ github.ref == 'refs/heads/main' }} | |
benchmark-with-state-root: | |
runs-on: [self-hosted, linux, benchmark] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
clean: false | |
- name: Build tests and install benchmark projects | |
run: |- | |
cd tests | |
npm clean-install | |
npm run build | |
cd ../benchmarking | |
npm i | |
- name: Build madara in release mode | |
run: cargo build --workspace --release --features madara-state-root | |
- name: Run benchmark | |
run: | | |
cd benchmarking | |
npm run test:ci-state-root | |
- name: Compare result | |
uses: benchmark-action/github-action-benchmark@v1 | |
with: | |
tool: "customBiggerIsBetter" | |
output-file-path: ./benchmarking/reports/metrics-state-root.json | |
alert-threshold: "120%" | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
fail-on-alert: true | |
summary-always: ${{ github.ref == 'refs/heads/main' }} | |
comment-always: false | |
comment-on-alert: false | |
benchmark-data-dir-path: "dev/bench-with-state-root" | |
auto-push: ${{ github.ref == 'refs/heads/main' }} |