Commit d0498d5c authored by Adrian DC's avatar Adrian DC
Browse files

chore: gitlab-ci: add 'Test' local job to run unit tests suites

parent 9c4edd2a
Loading
Loading
Loading
Loading
+16 −0
Changes for .gitlab-ci.yml: 16 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -70,6 +70,22 @@ stages:
  only:
    - local

'Test':
  stage: test
  image: local:silent
  script:
    - |
      if [ -z "${SUITE}" ]; then
        read -p " > Test suite : " -r SUITE
        echo ''
      fi
      sed -n '/^.unit-tests-template/,/^$/{ /  script/,/^$/{ /script:/n; s/^ *- //g; p } }' ./.gitlab-ci.yml | grep "/tests/${SUITE:?}" |
      while read -r line; do
        bash -c "${line}"
      done
  only:
    - local

.unit-tests-template: &unit-tests-template
  stage: test
  timeout: 10m