Benchmark Workflow #374
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 Workflow | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
action: | |
needs: [embedded-build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Download embedded artifacts (Linux) | |
uses: actions/download-artifact@v4 | |
with: | |
name: embedded-ubuntu-latest | |
- name: Download embedded artifacts (Windows) | |
uses: actions/download-artifact@v4 | |
with: | |
name: embedded-windows-latest | |
- name: Download embedded artifacts (MacOS) | |
uses: actions/download-artifact@v4 | |
with: | |
name: embedded-macos-latest | |
- name: Download SurrealDB | |
run: curl --proto '=https' --tlsv1.2 -sSf https://install.surrealdb.com | sh -s -- --version v1.5.5 | |
- name: Run SurrealDB root | |
run: surreal start --user root --pass root memory --allow-guests & | |
- name: Setup dotnet 8.0 | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: "8.0.x" | |
- name: Assign benchmark mode | |
run: ./prepare_embedded_benchmarks.sh -s | |
- name: Execute Remote benchmarks | |
run: sudo dotnet run -c Release --project SurrealDb.Net.Benchmarks.Remote --filter '*' | |
- name: Execute Embedded benchmarks | |
run: sudo dotnet run -c Release --project SurrealDb.Net.Benchmarks.Embedded --filter '*' | |
- name: Revert benchmark mode | |
run: ./prepare_embedded_benchmarks.sh -e | |
- name: Download previous benchmark data | |
uses: actions/cache@v1 | |
with: | |
path: ./cache | |
key: ${{ runner.os }}-benchmark | |
- name: Store benchmark result | |
uses: rhysd/github-action-benchmark@v1 | |
with: | |
tool: "benchmarkdotnet" | |
output-file-path: BenchmarkDotNet.Artifacts/results/Combined.Benchmarks.json | |
external-data-json-path: ./cache/benchmark-data.json | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
comment-on-alert: true | |
summary-always: true | |
embedded-build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
include: | |
# expand matrix configuration to add "libpath" variable | |
- os: windows-latest | |
libpath: | | |
**/release/surreal_memory.dll | |
**/release/surreal_memory.pdb | |
- os: ubuntu-latest | |
libpath: | | |
**/release/libsurreal_memory.so | |
- os: macos-latest | |
libpath: | | |
**/release/libsurreal_memory.dylib | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
sparse-checkout: | | |
rust-embedded | |
- name: Install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Cache Rust dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Build libraries | |
working-directory: ./rust-embedded | |
run: cargo build --release | |
- name: Publish embedded artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: embedded-${{ matrix.os }} | |
path: ${{ matrix.libpath }} |