image: ocaml/opam:ubuntu

stages:
  - build
  - release

test:
  stage: build
  script:
    - opam repo add opamorg "https://opam.ocaml.org/1.2.2"
    - opam repo add verimag-sync-repo "http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/opam-repository"
    - opam update -y
    - opam switch 4.07.0
    - eval `opam config env`
    - opam depext -y lustre-v6  lutin
    - opam install -y dune ocamlgraph lutin
    - make
    - make test

# automating version numbering
release:
  before_script:
    - yarn install --frozen-lockfile
  image: node:8
  only:
    - master
  script:
    - $(yarn bin)/semantic-release-gitlab  --preset eslint
  stage: release
