Parcourir la source

Using script for Gitlab CI

 + The tests were quite successful, we are using it for the CI rules.
 + Complete the script.
Leo il y a 9 ans
Parent
commit
2e5ebb34b7
2 fichiers modifiés avec 12 ajouts et 11 suppressions
  1. 2 6
      .gitlab-ci.yml
  2. 10 5
      gitlab-ci.sh

+ 2 - 6
.gitlab-ci.yml

@@ -4,12 +4,8 @@ before_script:
 
 # OCaml version of the ci runner, i.e. from the system
 ocaml_sys:
-  script: "opam init;eval `opam config env`;echo 'let ()=try Topdirs.dir_directory (Sys.getenv \"OCAML_TOPLEVEL_PATH\") with Not_found -> ();;' >  ~/.ocamlinit;./configure --enable-tests;make test;opam pin add oclaunch ."
+  script: "./gitlab-ci.sh system"
 
 # OCaml version 4.02
 ocaml_402:
-  script: "opam init --comp 4.02.3;eval `opam config env`;./configure --enable-tests;make test;opam pin add oclaunch ."
-
-# A script to test
-ocaml_script:
-  script: "./gitlab-ci.sh"
+  script: "./gitlab-ci.sh 4.02.3"

+ 10 - 5
gitlab-ci.sh

@@ -1,20 +1,25 @@
 #!/bin/sh
 
+# Give OCaml version as first argument
+
 # Inspired by https://github.com/ocaml/ocaml-ci-scripts
 
+# Use -y with evry opam command
+OPAMYES=true
 # Installing opam
-opam init --comp="4.02.2"
-
+opam init --comp="$1"
 eval `opam config env`
 
+# Versions
 opam --version
 opam --git-version
 ocaml -version
 
 # ocamlfind is mandatory to build
-opam install -y ocamlfind
+opam install ocamlfind
 
+# Installing dependancies and testing installation
+opam pin add oclaunch-ci .
 # Building OcLaunch and running tests
 ./configure --enable-tests
-make
-./test.native
+make test