Migrate to simple images to speedup CI

This commit is contained in:
ErickSkrauch 2020-01-15 18:57:20 +03:00
parent f05409c218
commit 51016c971b
No known key found for this signature in database
GPG Key ID: 669339FCBB30EE0E

View File

@ -1,12 +1,12 @@
variables: variables:
NODE_IMAGE: node:12-alpine
NODE_E2E_IMAGE: circleci/node:12-buster-browsers
DEPLOY_IMAGE: docksal/ssh-agent:1.3
# To cache both npm modules and Cypress binary we use environment variables # To cache both npm modules and Cypress binary we use environment variables
# to point at the folders we can list as paths in "cache" job settings # to point at the folders we can list as paths in "cache" job settings
YARN_CACHE_FOLDER: "$CI_PROJECT_DIR/cache/yarn" YARN_CACHE_FOLDER: "$CI_PROJECT_DIR/cache/yarn"
CYPRESS_CACHE_FOLDER: "$CI_PROJECT_DIR/cache/cypress" CYPRESS_CACHE_FOLDER: "$CI_PROJECT_DIR/cache/cypress"
default:
image: circleci/node:12
stages: stages:
- prepare - prepare
- test - test
@ -19,6 +19,7 @@ stages:
export VERSION="${CI_COMMIT_TAG:-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}}" export VERSION="${CI_COMMIT_TAG:-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}}"
.installSentry: &installSentry |- .installSentry: &installSentry |-
apk add curl
curl -sL https://sentry.io/get-cli/ | bash curl -sL https://sentry.io/get-cli/ | bash
.setupSSH: &setupSSH |- .setupSSH: &setupSSH |-
@ -55,6 +56,7 @@ stages:
Yarn: Yarn:
stage: prepare stage: prepare
image: $NODE_IMAGE
extends: extends:
- .yarnCache - .yarnCache
cache: cache:
@ -66,6 +68,7 @@ Yarn:
Yarn E2E: Yarn E2E:
stage: prepare stage: prepare
image: $NODE_E2E_IMAGE
extends: extends:
- .yarnE2ECache - .yarnE2ECache
cache: cache:
@ -82,6 +85,9 @@ Yarn E2E:
Lint: Lint:
stage: test stage: test
image: $NODE_IMAGE
needs:
- Yarn
extends: extends:
- .yarnCache - .yarnCache
script: script:
@ -89,6 +95,9 @@ Lint:
TypeScript: TypeScript:
stage: test stage: test
image: $NODE_IMAGE
needs:
- Yarn
extends: extends:
- .yarnCache - .yarnCache
script: script:
@ -96,6 +105,9 @@ TypeScript:
Jest: Jest:
stage: test stage: test
image: $NODE_IMAGE
needs:
- Yarn
extends: extends:
- .yarnCache - .yarnCache
script: script:
@ -103,7 +115,9 @@ Jest:
Cypress: Cypress:
stage: test stage: test
image: circleci/node:12-buster-browsers image: $NODE_E2E_IMAGE
needs:
- Yarn E2E
extends: extends:
- .yarnE2ECache - .yarnE2ECache
variables: variables:
@ -119,7 +133,7 @@ Cypress:
--browser chrome --browser chrome
--parallel --parallel
parallel: 4 parallel: 4
timeout: 5m timeout: 10m
allow_failure: true allow_failure: true
only: only:
refs: refs:
@ -131,6 +145,7 @@ Cypress:
Build: Build:
stage: build stage: build
image: $NODE_IMAGE
needs: needs:
- Lint - Lint
- TypeScript - TypeScript
@ -139,7 +154,6 @@ Build:
- .yarnCache - .yarnCache
before_script: before_script:
- *defineVars - *defineVars
- sudo apt install cpio
script: script:
- yarn build - yarn build
# Remove unneeded files # Remove unneeded files
@ -165,11 +179,12 @@ Build:
.deployJob: .deployJob:
stage: deploy stage: deploy
image: $DEPLOY_IMAGE
before_script: before_script:
- *defineVars - *defineVars
- *installSentry - *installSentry
- *setupSSH - *setupSSH
- sudo apt install rsync - apk add rsync
script: script:
# Send release to the Sentry # Send release to the Sentry
- sentry-cli releases new $VERSION - sentry-cli releases new $VERSION