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


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



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

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


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

#
# Deploy
#
deploy:
  needs: [ "arm32", "arm64",  "ubuntu22" ] # "fuzz"
  stage: deploy
  script:
    - ./cicd_testing/do-deploy.sh
  tags:
    - ubuntu22