From c8c209095abd9d1094ba50ffb3fc604eccaf4558 Mon Sep 17 00:00:00 2001 From: Michael Dales Date: Tue, 21 May 2024 17:03:02 +0100 Subject: [PATCH] Add git import test using simple go project --- specs/build-test.md | 28 ++++++++++++++++++++++++++++ specs/ocaml-test.md | 27 --------------------------- 2 files changed, 28 insertions(+), 27 deletions(-) create mode 100644 specs/build-test.md delete mode 100644 specs/ocaml-test.md diff --git a/specs/build-test.md b/specs/build-test.md new file mode 100644 index 00000000..8a87af66 --- /dev/null +++ b/specs/build-test.md @@ -0,0 +1,28 @@ +# Testing an git checkout and build + +This spec is a test of using a git repository import in shark to pull an data to a shark environment: + +```shark-import +https://github.com/quantifyearth/littlejohn.git /data/littlejohn +``` + +This project happens to be in golang, so we'll need a Go build environment: + +```shark-build:golang +((from "golang:latest")) +``` + +We can then do the build and copy the result to a shark friendly location: + +```shark-run:golang +$ cd /data/littlejohn +$ mkdir /data/build/ +$ GOPATH=/data/build go install +$ ls -laR /data/build +``` + +And then publish the results + +```shark-publish +/data/build/bin/littlejohn +``` diff --git a/specs/ocaml-test.md b/specs/ocaml-test.md deleted file mode 100644 index 5862901c..00000000 --- a/specs/ocaml-test.md +++ /dev/null @@ -1,27 +0,0 @@ -# Testing an OCaml Library - -The simplest way to test a dune-based OCaml library is to install the libraries -dependencies and then run the tests. - -First, you'll need to grab the source code. - -```shark-import -https://github.com/patricoferris/ppx_deriving_yaml.git /data/ppx_deriving_yaml -``` - -Then setup an OCaml environment, luckily we have the `ocaml/opam` images that do the -heavy-lifting for us. - -```shark-build:ocaml-env -((from "ocaml/opam")) -``` - -Then we can run our commands to install dependencies. - - - -```shark-run:ocaml-env -$ opam install /data/ppx_deriving_yaml --deps-only --with-test -$ opam exec -- dune build --root /data/ppx_deriving_yaml @install @runtest -``` -