Skip to content

added more OS to benchmark #5

added more OS to benchmark

added more OS to benchmark #5

Workflow file for this run

name: Benchmark Mining Code
on:
pull_request:
branches:
- main
jobs:
benchmark:
strategy:
matrix:
include:
- os: ubuntu-latest
arch: x64
- os: windows-latest
arch: x64
- os: macos-13
arch: x64
- os: macos-14
arch: arm64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: setup toolchain
uses: hecrj/setup-rust-action@v1
with:
rust-version: stable
- name: Build the project
run: cargo build --release
- name: Run benchmark (unix)
if: ${{ matrix.os != "windows-latest" }}

Check failure on line 41 in .github/workflows/benchmark.yml

View workflow run for this annotation

GitHub Actions / Benchmark Mining Code

Invalid workflow file

The workflow is not valid. .github/workflows/benchmark.yml (Line: 41, Col: 13): Unexpected symbol: '"windows-latest"'. Located at position 14 within expression: matrix.os != "windows-latest" .github/workflows/benchmark.yml (Line: 51, Col: 13): Unexpected symbol: '"windows-latest"'. Located at position 14 within expression: matrix.os == "windows-latest"
run: |
echo "Running benchmark for mining code..."
start_time=$(date +%s%N) # Get start time in nanoseconds
./target/release/mining-btc
end_time=$(date +%s%N) # Get end time in nanoseconds
elapsed_time=$((end_time - start_time)) # Calculate elapsed time
echo "Elapsed time: $((elapsed_time / 1000000)) ms" # Convert to milliseconds
- name: Run benchmark (windows)
if: ${{ matrix.os == "windows-latest" }}
shell: pwsh
run: |
Write-Output "Running benchmark for mining code..."
$startTime = [DateTime]::UtcNow.Ticks
./target/release/mining-btc
$endTime = [DateTime]::UtcNow.Ticks
$elapsedTime = ($endTime - $startTime) / 10000
Write-Output "Elapsed time: $elapsedTime ms"