Skip to content

Updated more examples to new syntax #1388

Updated more examples to new syntax

Updated more examples to new syntax #1388

Workflow file for this run

name: Azle Benchmarks
on:
pull_request:
jobs:
benchmarks:
runs-on: ubuntu-latest
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} # All commits must be verified
strategy:
fail-fast: false # We want to see which benchmarks succeed and which ones fail, we don't want one benchmark to cancel the rest
matrix:
rust: [stable]
benchmark_directories:
- examples/bytes
- examples/key_value_store
- examples/motoko_examples/calc
- examples/motoko_examples/counter
- examples/motoko_examples/factorial
- examples/motoko_examples/minimal-counter-dapp
- examples/motoko_examples/persistent-storage
- examples/motoko_examples/phone-book
- examples/motoko_examples/quicksort
- examples/motoko_examples/simple-to-do
- examples/motoko_examples/superheroes
- examples/motoko_examples/whoami
- examples/primitive_ops
- examples/update
if: ${{ contains(github.head_ref, '--benchmarks') }}
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/setup-node@v3
with:
node-version: 18
- run: DFX_VERSION=0.12.1 sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"
- name: Install Rust ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
- name: Rust cache
uses: actions/cache@v2
continue-on-error: false
with:
path: ${{ matrix.benchmark_directories }}/target
key: ${{ matrix.benchmark_directories }}-cache
restore-keys: ${{ matrix.benchmark_directories }}-cache # TODO might need to be more intelligent and hash files here
- shell: bash -l {0} # TODO figure out why this is here and comment about it
run: npm install
- shell: bash -l {0}
run: npm link
- working-directory: ${{ matrix.benchmark_directories }}
run: dfx start --clean --background --host 127.0.0.1:8000
- shell: bash -l {0}
working-directory: ${{ matrix.benchmark_directories }}
run: npm install
- shell: bash -l {0}
working-directory: ${{ matrix.benchmark_directories }}
run: npm link azle
- shell: bash -l {0}
working-directory: ${{ matrix.benchmark_directories }}
run: npm run benchmark
- run: git config --global user.name 'Jordan Last'
- run: git config --global user.email '[email protected]'
- run: git config --global commit.gpgsign true
- run: echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
- run: git config --global user.signingkey C8B77BCBE16CD2B94B43F9C8757397B82D4ED7B0
- run: git add --all
- run: git commit -am "benchmarks for ${{ matrix.benchmark_directories }}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
branch: benchmarks_${{ matrix.benchmark_directories }}
title: Added benchmarks for ${{ matrix.benchmark_directories }}