default: image: node:16-buster cache: &global_cache key: $CI_COMMIT_REF_SLUG paths: - node_modules policy: pull variables: CYPRESS_CACHE_FOLDER: "$CI_PROJECT_DIR/.cache/Cypress" stages: - Installation - Lint - Tests - Build - Release - Docs yarn: stage: Installation cache: <<: *global_cache policy: pull-push script: - git show-branch - yarn install --frozen-lockfile --silent linters: stage: Lint needs: - yarn script: - yarn commitlint --to $CI_COMMIT_SHA --verbose - yarn lint test_16: &test image: node:16-buster stage: Tests needs: - yarn before_script: - apt-get update - apt-get install --no-install-recommends -y - apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb -y - yarn cypress install script: - yarn test test_14: <<: *test image: node:14-buster test_12: <<: *test image: node:12-buster build: stage: Build needs: - linters - test_16 - test_14 - test_12 script: - yarn build artifacts: paths: - dist release: stage: Release needs: - build rules: - if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH" when: on_success - when: never script: - yarn semantic-release pages: stage: Docs needs: - release cache: <<: *global_cache rules: - if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH" when: on_success - when: never script: - yarn docs:build artifacts: paths: - public