

stages:
  - env
  - configure
  - build
  - install
  - test

env:bionic:
  image: keckj/hysop:bionic
  stage: env
  script:
      - "bash ci/scripts/version.sh"

config:bionic:
  image: keckj/hysop:bionic
  stage: configure
  script: 
      - "bash ci/scripts/config.sh $CI_PROJECT_DIR/build/gcc-7   $CI_PROJECT_DIR/install/gcc-7   gcc-7   g++-7     gfortran-7"
      - "bash ci/scripts/config.sh $CI_PROJECT_DIR/build/clang-8 $CI_PROJECT_DIR/install/clang-8 clang-8 clang++-8 gfortran-7"
  dependencies:
    - env:bionic
  artifacts:
    paths:
        - $CI_PROJECT_DIR/build

build:bionic:
  image: keckj/hysop:bionic
  stage: build
  script: 
      - "bash ci/scripts/build.sh $CI_PROJECT_DIR/build/gcc-7   gcc-7   g++-7     gfortran-7"
      - "bash ci/scripts/build.sh $CI_PROJECT_DIR/build/clang-8 clang-8 clang++-8 gfortran-7"
  dependencies:
    - config:bionic
  artifacts:
    paths:
        - $CI_PROJECT_DIR/build

install:bionic:
  image: keckj/hysop:bionic
  stage: install
  script: 
      - "bash ci/scripts/install.sh $CI_PROJECT_DIR/build/gcc-7 $CI_PROJECT_DIR/install/gcc-7"
  dependencies:
    - build:bionic
  artifacts:
    paths:
        - $CI_PROJECT_DIR/install

test:bionic:
  image: keckj/hysop:bionic
  stage: test
  script:
    - "bash ci/scripts/test.sh $CI_PROJECT_DIR/install/gcc-7 $CI_PROJECT_DIR/hysop $CI_PROJECT_DIR/cache"
  dependencies:
    - install:bionic
  cache:
    paths:
      - $CI_PROJECT_DIR/cache
    key: "hysop_cache"

