before_script:
  - "source ~gitlab-runner/cicd_support/cicd_support.shinc" 


after_script:
  - "echo Test Complete."

stages:
  - clean
  - build
  - test


#
# Cleaning
#
.do-nightly-clean: &do-nightly-clean
  stage: clean
  script:
    - ./cicd_testing/do-clean.sh 

# per os items
do-nightly-clean-ubuntu18:
  <<: *do-nightly-clean
  tags:
    - ubuntu18
  variables:
    OS: 'ubuntu18'  

# per os items
do-nightly-clean-ubuntu16:
  <<: *do-nightly-clean
  tags:
    - ubuntu16
  variables:
    OS: 'ubuntu16'  

# per os items
do-nightly-clean-centos75:
  <<: *do-nightly-clean
  tags:
    - centos75
  variables:
    OS: 'centos75'  


#
# Building
#
# template
.do-build: &do-build
  stage: build
  script:
    - ./cicd_testing/do-build.sh


# per os items
do-build-ubuntu18:
  <<: *do-build
  tags:
    - ubuntu18
  variables:
    OS: 'ubuntu18'  

do-build-ubuntu16:
  <<: *do-build
  tags:
    - ubuntu16
  variables:
    OS: 'ubuntu16'  

do-build-centos75:
  <<: *do-build
  tags:
    - centos75
  variables:
    OS: 'centos75'  


#
# test_quick for EH handling
#
.basic-pgms-rida: &eh-tests
  stage: test
  script:
    - ./irdb-libs/cicd_testing/eh-tests.sh

eh-tests-ubuntu18:
  <<: *eh-tests
  tags:
    - ubuntu18

eh-tests-ubuntu16:
  <<: *eh-tests
  tags:
    - ubuntu16

eh-tests-centos75:
  <<: *eh-tests
  tags:
    - centos75

#
# test_cmds.sh rida-p1
#
.basic-pgms-rida-p1: &basic-pgms-rida-p1
  stage: test
  script:
    - ./cicd_testing/basic-pgms-rida-p1.sh

basic-pgms-rida-p1-ubuntu18:
  <<: *basic-pgms-rida-p1
  tags:
    - ubuntu18

basic-pgms-rida-p1-ubuntu16:
  <<: *basic-pgms-rida-p1
  tags:
    - ubuntu16

basic-pgms-rida-p1-centos75:
  <<: *basic-pgms-rida-p1
  tags:
    - centos75

#
# test_cmds.sh fixcalls
#
.basic-pgms-fixcalls: &basic-pgms-fixcalls
  stage: test
  script:
    - ./cicd_testing/basic-pgms-fixcalls.sh

basic-pgms-fixcalls-ubuntu18:
  <<: *basic-pgms-fixcalls
  tags:
    - ubuntu18

basic-pgms-fixcalls-ubuntu16:
  <<: *basic-pgms-fixcalls
  tags:
    - ubuntu16

basic-pgms-fixcalls-centos75:
  <<: *basic-pgms-fixcalls
  tags:
    - centos75
  variables:
    OS: 'centos75'  

#
# elfdep test
#

# template
.elfdep: &elfdep
  stage: test
  script:
    - ./irdb-libs/cicd_tests/elfdep.sh

elfdep-ubuntu18:
  <<: *elfdep
  tags:
    - ubuntu18
  variables:
    OS: 'ubuntu18'  
    
elfdep-ubuntu16:
  <<: *elfdep
  tags:
    - ubuntu16
  variables:
    OS: 'ubuntu16'  

elfdep-centos75:
  <<: *elfdep
  tags:
    - centos75
  variables:
    OS: 'centos75'  
