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


after_script:
  - "echo Test Complete."

stages:
  - test
  - fuzz
  - deploy


.test: &do-test
  stage: test
  script:
    - ./cicd_testing/do-clean.sh
    - ./cicd_testing/do-build.sh
    - ./cicd_testing/do-test.sh

#
# test
#
ubuntu22:
  <<: *do-test
  tags:
    - ubuntu22

ubuntu20:
  <<: *do-test
  tags:
    - ubuntu20

ubuntu18:
  <<: *do-test
  script:
    - ./cicd_testing/do-clean.sh
  tags:
    - ubuntu18


arm32:
  <<: *do-test
  tags:
    - arm32

arm64:
  <<: *do-test
  tags:
    - arm64

centos76:
  <<: *do-test
  tags:
    - centos76

#
# Fuzz
#
fuzz:
  stage: fuzz
  script:
    - ./cicd_testing/do-fuzz.sh
  artifacts:
    paths: 
      - artifacts
    when: always
  tags:
    - fuzz

#
# Deploy
#
ubuntu22:
  stage: deploy
  script:
    - ./cicd_testing/do-deploy.sh
  tags:
    - ubuntu22
