Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/test-benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: BenchMark Test

on:
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: download benchmarks
run: |
cd ../
git clone --depth=1 https://x-access-token:${{ secrets.MY_PAT }}@github.com/kupl/dilemma-benchmark.git
cd dilemma

- name: install pandas
run: pip install pandas tabulate

- name: Set-up OCaml
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: 5.3.0
dune-cache: true

- name: dependency opam package
run: opam install . --deps-only -y

- name: build dilemma
run: |
eval $(opam env)
dune build

- name: test benchmark
run: |
eval $(opam env)
python3 runner.py

- name: aggregate
run: python3 runner.py --aggregate True

- name: Comment benchmark result
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const path = require('path');
const summaryDir = 'summary'
const files = fs.readdirSync(summaryDir).filter(file => file.endsWith('.md'));
if (files.length === 0) {
console.log('No summary markdown files found.');
return;
}

let commentBody = '### Benchmark Summaries\n\n'

for (const file of files){
const fullPath = path.join(summaryDir,file);
const content = fs.readFileSync(fullPath, 'utf8');

commentBody += '\n' + content + '\n';
}

const pr = context.payload.pull_request;
if (!pr){
core.warning('No pull request found.');
return;
}

await github.rest.issues.createComment({
issue_number: pr.number,
owner : context.repo.owner,
repo: context.repo.repo,
body: commentBody
});



12 changes: 12 additions & 0 deletions dilemma.opam
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ bug-reports: "https://github.com/kupl/dilemma/issues"
depends: [
"dune" {>= "3.17"}
"ocaml" {>= "5.3.0"}
"sexplib"
"ppxlib"
"ppx_sexp_conv"
"containers"
"core"
"ocaml-compiler-libs"
"ppx_deriving"
"containers-data"
"iter"
"alcotest"
"ocamldot"
"ppx_inline_alcotest"
"odoc" {with-doc}
]
build: [
Expand Down
14 changes: 13 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,19 @@
(description "A longer description")
(depends
(ocaml
(>= 5.3.0)))
(>= 5.3.0))
sexplib
ppxlib
ppx_sexp_conv
containers
core
ocaml-compiler-libs
ppx_deriving
containers-data
iter
alcotest
ocamldot
ppx_inline_alcotest)
(tags
("add topics" "to describe" your project)))

Expand Down