diff options
author | Marcel Amirault <mamirault@gitlab.com> | 2022-08-02 08:35:45 +0300 |
---|---|---|
committer | Evan Read <eread@gitlab.com> | 2022-08-02 08:35:45 +0300 |
commit | 8faf46d9b3c400152319e706e66784164603870e (patch) | |
tree | 24d670a3366f2f03a6f46673bbb72e256d8320c7 | |
parent | 000faa033fa7b6c9be989df92824333bf0b872cf (diff) |
Simplify yarn and bundle dependency and cache CI config
-rw-r--r-- | .gitlab/ci/deploy.gitlab-ci.yml | 3 | ||||
-rw-r--r-- | .gitlab/ci/rules.gitlab-ci.yml | 37 | ||||
-rw-r--r-- | .gitlab/ci/security.gitlab-ci.yml | 1 | ||||
-rw-r--r-- | .gitlab/ci/test.gitlab-ci.yml | 20 |
4 files changed, 27 insertions, 34 deletions
diff --git a/.gitlab/ci/deploy.gitlab-ci.yml b/.gitlab/ci/deploy.gitlab-ci.yml index f1b5e889..e1ba016e 100644 --- a/.gitlab/ci/deploy.gitlab-ci.yml +++ b/.gitlab/ci/deploy.gitlab-ci.yml @@ -5,10 +5,9 @@ .build_base: stage: build extends: - - .cache_gem_yarn - .retry + - .bundle_and_yarn script: - - yarn install --cache-folder .yarn-cache - bundle exec rake setup_git default - bundle exec nanoc compile -VV # Create _redirects for Pages redirects diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index 334008f2..29d9796e 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -6,22 +6,14 @@ default: image: registry.gitlab.com/gitlab-org/gitlab-docs/base:alpine-3.16-ruby-2.7.6-0bc327a4 tags: - gitlab-org - # Check Ruby, RubyGems, and Bundler versions and install gems - before_script: - - ruby -v - - gem -v - - bundle -v - - bundle config set --local deployment true # Install dependencies into ./vendor/ruby - - bundle install --jobs 4 -.yarn: +.bundle: before_script: - - yarn install --cache-folder .yarn-cache - -# -# Caching keys -# -.cache_gem: + - ruby --version + - gem --version + - bundle --version + - bundle config set --local deployment true # Install dependencies into ./vendor/bundle + - bundle install --jobs 4 cache: key: files: @@ -29,7 +21,16 @@ default: paths: - vendor/bundle -.cache_gem_yarn: +.bundle_and_yarn: + before_script: + - ruby --version + - gem --version + - bundle --version + - bundle config set --local deployment true # Install dependencies into ./vendor/bundle + - bundle install --jobs 4 + - node --version + - yarn --version + - yarn install --frozen-lockfile --cache-folder .yarn-cache cache: key: files: @@ -39,7 +40,11 @@ default: - vendor/bundle - .yarn-cache/ -.cache_yarn: +.yarn: + before_script: + - node --version + - yarn --version + - yarn install --frozen-lockfile --cache-folder .yarn-cache cache: key: files: diff --git a/.gitlab/ci/security.gitlab-ci.yml b/.gitlab/ci/security.gitlab-ci.yml index 52152504..5b39c8c8 100644 --- a/.gitlab/ci/security.gitlab-ci.yml +++ b/.gitlab/ci/security.gitlab-ci.yml @@ -18,7 +18,6 @@ stage: security dependencies: [] needs: [] - before_script: [] # # Dependency scanning job overrides diff --git a/.gitlab/ci/test.gitlab-ci.yml b/.gitlab/ci/test.gitlab-ci.yml index 779c1c36..fe2ab189 100644 --- a/.gitlab/ci/test.gitlab-ci.yml +++ b/.gitlab/ci/test.gitlab-ci.yml @@ -9,7 +9,7 @@ test_global_nav_links: image: registry.gitlab.com/gitlab-org/gitlab-docs/lint-html:alpine-3.16-ruby-2.7.6-0bc327a4 extends: - .rules_site_tests - - .cache_gem + - .bundle stage: test script: # Only check files in top-level directories. This means a much faster and less repetitive check of global navigation links. @@ -26,7 +26,6 @@ check_duplicate_redirects: extends: - .rules_site_tests needs: [] - before_script: [] stage: test script: - grep -Ir " - from:" content/_data/redirects.yaml | sort | uniq -d | tee output.txt @@ -40,7 +39,6 @@ check_index_html: extends: - .rules_site_tests needs: [] - before_script: [] stage: test script: # Check for index.html in navigation.yaml and write the output in output.txt @@ -58,11 +56,10 @@ check_index_html: rspec: extends: - .rules_site_tests - - .cache_gem_yarn + - .bundle_and_yarn needs: [] stage: test script: - - yarn install --cache-folder .yarn-cache - make rspec-tests # @@ -71,7 +68,6 @@ rspec: jest: extends: - .rules_site_tests - - .cache_yarn - .yarn needs: [] stage: test @@ -84,7 +80,6 @@ jest: js_lint: extends: - .rules_site_tests - - .cache_yarn - .yarn needs: [] stage: test @@ -98,7 +93,6 @@ js_lint: stylelint: extends: - .rules_site_tests - - .cache_yarn - .yarn needs: [] stage: test @@ -115,7 +109,6 @@ yaml_lint: needs: [] stage: test image: sdesbure/yamllint:latest - before_script: [] script: - yamllint .gitlab-ci.yml content/_data @@ -125,7 +118,6 @@ yaml_lint: markdownlint: extends: - .rules_site_tests - - .cache_yarn - .yarn needs: [] stage: test @@ -137,7 +129,7 @@ markdownlint: # test_external_links: extends: - - .cache_gem + - .bundle - .rules_chores stage: test script: @@ -149,7 +141,7 @@ test_external_links: test_EOL_whitespace: extends: - .rules_chores - - .cache_gem + - .bundle stage: test image: registry.gitlab.com/gitlab-org/gitlab-docs/lint-html:alpine-3.16-ruby-2.7.6-0bc327a4 needs: [] @@ -166,7 +158,7 @@ test_EOL_whitespace: test_unlinked_images: extends: - .rules_chores - - .cache_gem + - .bundle stage: test image: registry.gitlab.com/gitlab-org/gitlab-docs/lint-html:alpine-3.16-ruby-2.7.6-0bc327a4 needs: [] @@ -195,7 +187,6 @@ lint_dockerfiles: - .rules_site_tests image: hadolint/hadolint:latest-alpine needs: [] - before_script: [] dependencies: [] script: - hadolint latest.Dockerfile .gitpod.Dockerfile **/*.Dockerfile @@ -206,4 +197,3 @@ lint_dockerfiles: eslint-sast: stage: security - before_script: [] |