Browse Source

Merge branch 'newrc-format' of gitlab.com:WzukW/oclaunch into newrc-format

Leo 8 years ago
parent
commit
74d1e6b470
5 changed files with 456 additions and 364 deletions
  1. 88 9
      .gitlab-ci.yml
  2. 2 1
      CHANGELOG.md
  3. 21 9
      gitlab-ci.sh
  4. 1 1
      src/edit_command.ml
  5. 344 344
      src/licencing.ml

+ 88 - 9
.gitlab-ci.yml

@@ -1,15 +1,94 @@
-before_script:
-  - apt-get update -qq && apt-get install -y -qq opam ocaml ocaml-native-compilers
-  - opam --version
+stages:
+  # Test with alpine
+  - test
+  # Test with alpine, other version of the compiler
+  - other_version
+  # Real distrubutions
+  - real
 
-# OCaml version of the ci runner, i.e. from the system
-#ocaml_sys:
-#  script: "./gitlab-ci.sh system"
+# OCaml version 4.04
+ocaml_404:
+  before_script:
+    - sudo apk update && sudo apk add m4
+  stage: other_version
+  image: ocaml/opam:alpine_ocaml-4.04.0
+  script: "./gitlab-ci.sh"
+  allow_failure: true
+
+# OCaml version 4.04
+ocaml_404_flambda:
+  before_script:
+    - sudo apk update && sudo apk add m4
+  stage: other_version
+  image: ocaml/opam:alpine_ocaml-4.04.0_flambda
+  script: "./gitlab-ci.sh"
+  allow_failure: true
 
 # OCaml version 4.02
 ocaml_402:
-  script: "./gitlab-ci.sh 4.02.3"
+  before_script:
+    - sudo apk update && sudo apk add m4
+  stage: other_version
+  image: ocaml/opam:alpine_ocaml-4.02.3
+  script: "./gitlab-ci.sh"
+  allow_failure: true
 
 # OCaml version 4.03
-#ocaml_403:
-#  script: "./gitlab-ci.sh 4.03.0"
+ocaml_403:
+  before_script:
+    - sudo apk update && sudo apk add m4
+  stage: test
+  image: ocaml/opam:alpine_ocaml-4.03.0
+  script: "./gitlab-ci.sh"
+  allow_failure: false
+
+# OCaml version 4.03, with flambda optimisation
+ocaml_403_flambda:
+  before_script:
+    - sudo apk update && sudo apk add m4
+  stage: other_version
+  image: ocaml/opam:alpine_ocaml-4.03.0_flambda
+  script: "./gitlab-ci.sh"
+  allow_failure: true
+
+# ---------------
+ubuntu:
+  before_script:
+    - sudo apt-get update && sudo apt-get install -y m4
+  stage: real
+  image: ocaml/opam:ubuntu
+  script: "export OC_NOTEST=true; ./gitlab-ci.sh system"
+  allow_failure: true
+
+
+debian:
+  before_script:
+    - sudo apt-get update && sudo apt-get install -y m4
+  stage: real
+  image: ocaml/opam:debian
+  script: "export OC_NOTEST=true; ./gitlab-ci.sh system"
+  allow_failure: true
+
+centos:
+  before_script:
+    - sudo yum install -y m4
+  stage: real
+  image: ocaml/opam:centos
+  script: "export OC_NOTEST=true; ./gitlab-ci.sh system"
+  allow_failure: true
+
+fedora:
+  before_script:
+    - sudo dnf install -y m4
+  stage: real
+  image: ocaml/opam:fedora
+  script: "export OC_NOTEST=true; ./gitlab-ci.sh system"
+  allow_failure: true
+
+opensuse:
+  before_script:
+    - sudo zypper --non-interactive up && sudo zypper --non-interactive in m4
+  stage: real
+  image: ocaml/opam:opensuse
+  script: "export OC_NOTEST=true; ./gitlab-ci.sh system"
+  allow_failure: true

+ 2 - 1
CHANGELOG.md

@@ -80,7 +80,8 @@ This version introduce major changes in the tmp and rc file.
    release source-code, binaries, signing, run test…). Stripped (and thus smaller)
    binaries are being tested too. Add *indentation script* too.
  + Improve README.md file, using special code in \_oasis Description field.
- + Using Gitlab CI to build with several versions of the compiler.
+ + Using Gitlab CI to build with several versions of the compiler (fasten with
+   Docker).
 
 ## 0.2.x
 

+ 21 - 9
gitlab-ci.sh

@@ -1,13 +1,15 @@
 #!/bin/sh
 
-# Give OCaml version as first argument
+# OCaml version is assuming to be set (for instance as system compiler) if
+# nothing is passed
 
 # Inspired by https://github.com/ocaml/ocaml-ci-scripts
 
 # Use -y with evry opam command
 export OPAMYES=true
 # Installing opam
-opam init --comp="$1"
+comp=${1:-system}
+opam init --comp="${comp}"
 eval `opam config env`
 
 # Versions
@@ -20,17 +22,27 @@ echo "ocaml -version"
 ocaml -version
 echo "============"
 
+echo "= Dependancies ="
 # ocamlfind is mandatory to build
 opam install ocamlfind
-# XXX Manually install development dependancies, not yet supported (ait opam 1.3)
+# XXX Manually install development dependancies, not yet supported (wait opam 1.3)
 opam install alcotest oUnit
 
 # Installing dependancies and testing installation
 opam pin add oclaunch-ci .
-# Building OcLaunch and running tests
-./configure --enable-tests
-make test
+echo "============"
+
+# Run test if OC_NOTEST is false
+if [ ! ${OC_NOTEST} ]; then
+  # Build OcLaunch only
+  ./configure
+  make
+else
+  # Building OcLaunch and running tests
+  ./configure --enable-tests
+  make test
 
-# Test the produced binary
-oclaunch -version
-echo "En" | oclaunch
+  # Test the produced binary
+  oclaunch -version
+  echo "En" | oclaunch
+fi

+ 1 - 1
src/edit_command.ml

@@ -91,7 +91,7 @@ let rec run ~(rc:Rc.t) position =
   let original_command,shorter_list =
     Remove_command.remove current_list position
   in
-  Out_channel.write_all tmp_filename original_command;
+  Out_channel.write_all tmp_filename ~data:original_command;
 
 
   (* Edit file *)

File diff suppressed because it is too large
+ 344 - 344
src/licencing.ml