Skip to content

Commit

Permalink
Migrated bechmarks to gitlab (#1151)
Browse files Browse the repository at this point in the history
* ci: bench pipeline refactored to gitlab

* fix: missing label trigger

* Corrected env variable GITHUB_SHA

* fix: corrected url

* ci: actions trigger and download benchmarks correctly (at least in my machine)

---------

Co-authored-by: Fabian Hoppe <112093564+mrfh92@users.noreply.github.com>
Co-authored-by: Claudia Comito <39374113+ClaudiaComito@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 7, 2023
1 parent 7482f14 commit f9d1919
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 90 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/bench_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Benchmarks report
on:
workflow_dispatch:
inputs:
job_id:
required: true
type: string

jobs:
bench_report:
name: Benchmark report
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: "Download artifact"
run: |
curl --location \
--header "PRIVATE-TOKEN: ${{ secrets.GITLAB_TOKEN }}" \
--output perun_benchmarks.json \
"https://codebase.helmholtz.cloud/api/v4/projects/7930/jobs/${{ inputs.job_id }}/artifacts/heat/bench_data/perun_benchmarks.json"
- name: Save benchmark result and update gh-pages-chart
if: ${{github.ref == 'refs/heads/main'}}
uses: benchmark-action/github-action-benchmark@v1
with:
github-token: ${{secrets.GITHUB_TOKEN}}
# Benchmark action input and output
tool: "customSmallerIsBetter"
output-file-path: perun_benchmarks.json
# Alert configuration
fail-on-alert: false # Don't fail on main branch
comment-on-alert: true
# Save benchmarks from the main branch
save-data-file: true
# Pages configuration
auto-push: true
gh-pages-branch: gh-pages
benchmark-data-dir-path: dev/bench
- name: Compare benchmark result
if: ${{github.ref != 'refs/heads/main'}}
uses: benchmark-action/github-action-benchmark@v1
with:
github-token: ${{secrets.GITHUB_TOKEN}}
# Benchmark action input and output
tool: 'customSmallerIsBetter'
output-file-path: perun_benchmarks.json
# Alert configuration
fail-on-alert: true
comment-on-alert: true
# Ignore results from non main branches.
save-data-file: false
# Pages configuration
auto-push: false
gh-pages-branch: gh-pages
benchmark-data-dir-path: dev/bench
28 changes: 28 additions & 0 deletions .github/workflows/bench_trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Trigger benchmarks
on:
push:
branches:
- main
pull_request_target:
types: [opened, synchronize, reopened, labeled]

jobs:
trigger-benchmark:
name: Trigger Benchmark
runs-on: ubuntu-latest
steps:
- name: Trigger benchmarks (PR)
id: setup_pr
if: contains(github.event.pull_request.labels.*.name, 'benchmark PR')
run: |
curl -s -X POST --fail -F token=${{ secrets.BENCH_PIPE_TRIGGER }} -F "ref=main" -F "variables[PR]=${{ github.event.pull_request.number }}" https://codebase.helmholtz.cloud/api/v4/projects/7930/trigger/pipeline -o /dev/null
- name: Trigger benchmarks (Push main)
id: setup_push
if: ${{ github.event_name == 'push' }}
run: |
curl -s -X POST \
--fail \
-F "token=${{ secrets.BENCH_PIPE_TRIGGER }}" \
-F "ref=main" \
-F "variables[SHA]=$GITHUB_SHA" \
https://codebase.helmholtz.cloud/api/v4/projects/7930/trigger/pipeline -o /dev/null
45 changes: 0 additions & 45 deletions .github/workflows/benchmark_main.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/workflows/benchmark_pr.yml

This file was deleted.

0 comments on commit f9d1919

Please sign in to comment.