diff --git a/caisar.opam b/caisar.opam
index ed401cf1ec40ab007e9662cd60347161bc0a907e..67fd9e900fd9259a0c452bb8ebe4d22ed5c896c2 100644
--- a/caisar.opam
+++ b/caisar.opam
@@ -38,6 +38,7 @@ depends: [
   "conf-python-3" {with-test}
   "odoc" {with-doc}
 ]
+dev-repo: "git+https://git.frama-c.com/pub/caisar.git"
 build: [
   ["dune" "subst"] {dev}
   [
@@ -49,9 +50,9 @@ build: [
     jobs
     "--promote-install-files=false"
     "@install"
+    "@ensures-onnx"
     "@runtest" {with-test}
     "@doc" {with-doc}
   ]
   ["dune" "install" "-p" name "--create-install-files" name]
 ]
-dev-repo: "git+https://git.frama-c.com/pub/caisar.git"
diff --git a/caisar.opam.template b/caisar.opam.template
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..921585e416199d3c7ba93d30d41bb8d390a5d4d9 100644
--- a/caisar.opam.template
+++ b/caisar.opam.template
@@ -0,0 +1,17 @@
+build: [
+  ["dune" "subst"] {dev}
+  [
+    "dune"
+    "build"
+    "-p"
+    name
+    "-j"
+    jobs
+    "--promote-install-files=false"
+    "@install"
+    "@ensures-onnx"
+    "@runtest" {with-test}
+    "@doc" {with-doc}
+  ]
+  ["dune" "install" "-p" name "--create-install-files" name]
+]
diff --git a/tests/dune b/tests/dune
index 57ad5a8b44642c58d7b71467d5250f22bfb4ae90..35bc5f6acb8ea29105f991746e247d78198c92cf 100644
--- a/tests/dune
+++ b/tests/dune
@@ -1,3 +1,10 @@
+(rule
+  (alias ensures-onnx)
+  (deps (package caisar))
+  (action
+    (system "curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py && python3 -m pip install onnx"))
+)
+
 (cram
  (alias local)
  (applies_to * \ nir_to_onnx acasxu_ci arithmetic comparison sequencing)