Benchmark #33
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: | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
target_url: | |
type: string | |
description: url of target | |
baseline_url: | |
type: string | |
description: url of baseline | |
jobs: | |
RunBenchmark: | |
runs-on: ubuntu-latest | |
env: | |
TARGET_URL: ${{ github.event.inputs.target_url || format('{0}#{1}', github.event.pull_request.head.repo.html_url, github.event.pull_request.head.sha) }} | |
BASELINE_URL: ${{ github.event.inputs.baseline_url || format('{0}#{1}', github.event.pull_request.base.repo.html_url, github.event.pull_request.base.sha) }} | |
steps: | |
- | |
run: | | |
echo "Target repo url: $TARGET_URL" | |
echo "Baseline repo url: $BASELINE_URL" | |
- | |
name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup main branch locally without switching current branch | |
if: ${{ github.event_name == 'pull_request' }} | |
run: git fetch origin main:main | |
- | |
name: Setup julia | |
uses: julia-actions/setup-julia@v1 | |
- | |
name: Build pkg | |
uses: julia-actions/julia-buildpkg@v1 | |
- | |
id: benchmark | |
name: Run benchmark | |
run: | | |
julia --project=benchmark benchmark/runbenchmarks-pr.jl --target=$TARGET_URL --baseline=$BASELINE_URL | |
- | |
name: Print report | |
run: | | |
cat benchmark/report.md | |
- | |
name: Upload report | |
uses: actions/upload-artifact@v2 | |
with: | |
name: report.md | |
path: benchmark/report.md |