From 65342122517759c9175071664a8d53b1bc865206 Mon Sep 17 00:00:00 2001 From: Sergii Mykyteiek Date: Wed, 6 Oct 2021 16:38:44 +0300 Subject: [PATCH] LT-12: Define gitlab-ci.yml file with test run script --- .gitlab-ci.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..60c66e2 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,29 @@ +image: node:14 + +stages: + - build + - test + +cache: + key: ${CI_COMMIT_REF_SLUG} + paths: + - .npm/ + +build-app-job: + stage: build + script: + - echo "Commit branch '$CI_COMMIT_BRANCH'" + - npm ci --cache .npm --prefer-offline + - echo "Success building" + rules: + - if: '$CI_COMMIT_BRANCH == "develop"' + - if: '$CI_COMMIT_BRANCH == "main"' + +test-run-job: + stage: test + script: + - echo "Run test starting" + - npm run test + rules: + - if: '$CI_COMMIT_BRANCH == "develop"' + - if: '$CI_COMMIT_BRANCH == "main"' \ No newline at end of file -- GitLab