---
image: mathiwr/amdis-base:debian9

stages:
  - build
  - demo
  - test


# compile amdis
build:9-debug-gcc:
  stage: build
  script:
  - tools/build_amdis.sh --stage build --config Debug
  artifacts:
    paths:
    - install/
  only:
  - master

build:9-release-gcc:
  stage: build
  script:
  - tools/build_amdis.sh --stage build --config Release
  artifacts:
    paths:
    - install/
  only:
  - master

build:9-parallel-debug-gcc:
  stage: build
  script:
  - tools/build_amdis.sh --stage build --config Debug --parallel
  artifacts:
    paths:
    - install/
  only:
  - master

build:9-parallel-release-gcc:
  stage: build
  script:
  - tools/build_amdis.sh --stage build --config Release --parallel
  artifacts:
    paths:
    - install/
  only:
  - master


# compile the demos
demo:9-debug-gcc:
  stage: demo
  script:
  - tools/build_amdis.sh --stage demo --config Debug
  dependencies:
  - build:9-debug-gcc
  only:
  - master

demo:9-release-gcc:
  stage: demo
  script:
  - tools/build_amdis.sh --stage demo --config Release
  dependencies:
  - build:9-release-gcc
  only:
  - master

demo:9-parallel-debug-gcc:
  stage: demo
  script:
  - tools/build_amdis.sh --stage demo --config Debug --parallel
  dependencies:
  - build:9-parallel-debug-gcc
  only:
  - master

demo:9-parallel-release-gcc:
  stage: demo
  script:
  - tools/build_amdis.sh --stage demo --config Release --parallel
  dependencies:
  - build:9-parallel-release-gcc
  only:
  - master


# compiel and run the tests
test:9-debug-gcc:
  stage: test
  script:
  - tools/build_amdis.sh --stage test --config Debug
  dependencies:
  - build:9-debug-gcc
  only:
  - master

test:9-release-gcc:
  stage: test
  script:
  - tools/build_amdis.sh --stage test --config Release
  dependencies:
  - build:9-release-gcc
  only:
  - master

test:9-parallel-debug-gcc:
  stage: test
  script:
  - tools/build_amdis.sh --stage test --config Debug --parallel
  dependencies:
  - build:9-parallel-debug-gcc
  only:
  - master

test:9-parallel-release-gcc:
  stage: test
  script:
  - tools/build_amdis.sh --stage test --config Release --parallel
  dependencies:
  - build:9-parallel-release-gcc
  only:
  - master