Skip to content

Commit

Permalink
Add support for the x-ci-accept-failures custom field
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate committed Dec 31, 2020
1 parent eb73890 commit 54a439b
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions lib/opam_build.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,23 @@ let opam_install ~upgrade_opam ~pin ~with_tests ~pkg =
in
pin @ [
(* TODO: Replace by two calls to opam install + opam install -t using the OPAMDROPINSTALLEDPACKAGES feature *)
if upgrade_opam then
run ~cache ~network "opam remove -y %s && opam install -y%s %s" pkg (if with_tests then "t" else "") pkg
else
run ~cache ~network "opam remove -y %s && opam depext -uivy%s %s" pkg (if with_tests then "t" else "") pkg
run ~cache ~network {|
opam remove -y %s && opam %s%s %s
test "$?" != 31 && exit 1
export OPAMCLI=2.0
build_dir=$(opam var prefix)/.opam-switch/build
failed=$(ls "$build_dir")
for pkg in $failed do
if opam show -f x-ci-accept-failures: "$pkg" | grep -qF "\"$(opam var os-distribution)-$(opam var os-version)\"" then
echo "A package failed and has been disabled for CI using the 'x-ci-accept-failures' field."
fi
done
exit 1
|}
pkg
(if upgrade_opam then "install -y" else "depext -uivy")
(if with_tests then "t" else "")
pkg
]

let setup_repository ~upgrade_opam ~variant =
Expand Down

0 comments on commit 54a439b

Please sign in to comment.