Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/GitGab19/stratum into benche…
Browse files Browse the repository at this point in the history
…r_testing
  • Loading branch information
GitGab19 committed Sep 14, 2023
2 parents 1f92c43 + 7572e59 commit 23c67a5
Show file tree
Hide file tree
Showing 2 changed files with 201 additions and 1 deletion.
200 changes: 200 additions & 0 deletions .github/workflows/bencher.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
name: Bencher

on:
workflow_run:
workflows: [Run and Cache Benchmarks]
types:
- completed

jobs:
track_sv1_criterion_with_bencher:
name: Track sv1 criterion benchmarks with Bencher
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
env:
BENCHER_PROJECT: stratum
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
BENCHER_ADAPTER: rust_criterion
BENCHER_TESTBED: sv1
steps:
- name: Download Benchmark Results
uses: actions/github-script@v6
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "criterion_sv1_benchmarks"
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/criterion_sv1_benchmarks.zip`, Buffer.from(download.data));
- name: Unzip Benchmark Results
run: unzip criterion_sv1_benchmarks.zip

- name: Setup Bencher
#uses: bencherdev/bencher@main
uses: baptiste0928/cargo-install@v2
with:
crate: bencher_cli
git: https://github.com/bencherdev/bencher
branch: devel

- name: Track Benchmarks with Bencher
run: |
cat criterion_sv1_benchmarks.txt | bencher run \
--err \
--github-actions ${{ secrets.GITHUB_TOKEN }}
track_sv2_criterion_with_bencher:
name: Track sv1 criterion benchmarks with Bencher
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
env:
BENCHER_PROJECT: stratum
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
BENCHER_ADAPTER: rust_criterion
BENCHER_TESTBED: sv2
steps:
- name: Download Benchmark Results
uses: actions/github-script@v6
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "criterion_sv2_benchmarks"
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/criterion_sv2_benchmarks.zip`, Buffer.from(download.data));
- name: Unzip Benchmark Results
run: unzip criterion_sv2_benchmarks.zip

- name: Setup Bencher
#uses: bencherdev/bencher@main
uses: baptiste0928/cargo-install@v2
with:
crate: bencher_cli
git: https://github.com/bencherdev/bencher
branch: devel

- name: Track Benchmarks with Bencher
run: |
cat criterion_sv2_benchmarks.txt | bencher run \
--err \
--github-actions ${{ secrets.GITHUB_TOKEN }}
track_sv1_iai_with_bencher:
name: Track sv1 iai benchmarks with Bencher
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
env:
BENCHER_PROJECT: stratum
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
BENCHER_ADAPTER: rust_iai
BENCHER_TESTBED: sv1
steps:
- name: Download Benchmark Results
uses: actions/github-script@v6
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "iai_sv1_benchmarks"
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/iai_sv1_benchmarks.zip`, Buffer.from(download.data));
- name: Unzip Benchmark Results
run: unzip iai_sv1_benchmarks.zip

- name: Setup Bencher
#uses: bencherdev/bencher@main
uses: baptiste0928/cargo-install@v2
with:
crate: bencher_cli
git: https://github.com/bencherdev/bencher
branch: devel

- name: Track Benchmarks with Bencher
run: |
cat iai_sv1_benchmarks.txt | bencher run \
--err \
--github-actions ${{ secrets.GITHUB_TOKEN }}
track_sv2_iai_with_bencher:
name: Track sv2 iai benchmarks with Bencher
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
env:
BENCHER_PROJECT: stratum
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
BENCHER_ADAPTER: rust_iai
BENCHER_TESTBED: sv2
steps:
- name: Download Benchmark Results
uses: actions/github-script@v6
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "iai_sv2_benchmarks"
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/iai_sv2_benchmarks.zip`, Buffer.from(download.data));
- name: Unzip Benchmark Results
run: unzip iai_sv2_benchmarks.zip

- name: Setup Bencher
#uses: bencherdev/bencher@main
uses: baptiste0928/cargo-install@v2
with:
crate: bencher_cli
git: https://github.com/bencherdev/bencher
branch: devel

- name: Track Benchmarks with Bencher
run: |
cat iai_sv2_benchmarks.txt | bencher run \
--err \
--github-actions ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ jobs:
- uses: actions/upload-artifact@v3
with:
name: iai_sv2_benchmarks.txt
path: ./benches/iai_sv2_benchmarks.txt
path: ./benches/iai_sv2_benchmarks.txt

0 comments on commit 23c67a5

Please sign in to comment.