Просмотр исходного кода

Maintenance: Refactored GitLab cache handling and added cache for yarn.

Martin Gruner 2 лет назад
Родитель
Сommit
e743ab78f3
3 измененных файлов с 20 добавлено и 15 удалено
  1. 2 1
      .gitignore
  2. 13 14
      .gitlab-ci.yml
  3. 5 0
      .yarnrc

+ 2 - 1
.gitignore

@@ -89,12 +89,13 @@
 *~
 
 # Vite Ruby
-yarn-error.log
 /public/vite
 /public/vite-dev
 
 # Node
 **/node_modules
+yarn-error.log
+.yarn/cache
 
 # Storybook
 .storybook/storybook-static

+ 13 - 14
.gitlab-ci.yml

@@ -40,21 +40,20 @@ variables:
   # Temporary switch to enable the mobile front end for testing.
   ENABLE_EXPERIMENTAL_MOBILE_FRONTEND: 'true'
 
-# Cache gems in between jobs and pipelines
-# ATTENTION: We use a combination of the Ruby major and minor version number
-# as a key for the cache to avoid cache growth and incompatibilities between
-# the gems. Search hook: 3.0.4 (change it when updating the Ruby version too)
 cache:
-  key: "centos7ruby304"
-  paths:
-    - vendor/ruby
-    # ATTENTION: This should be a dedicated cache only used in the job "TODO".
-    # ATTENTION: Remember to update the global CI ENV setting with the latest
-    #   version of the ENV from an artifact of the "TODO" job to use a valid key.
-    # A dedicated cache should be used because the ENVs are not bound to the Ruby version and OS.
-    # Unfortunately GitLab is not yet capable of having multiple cache-s per job
-    # See: https://gitlab.com/gitlab-org/gitlab/-/issues/32814
-    - fresh.env
+  # Cache gems in between jobs and pipelines
+  - key:
+      files:
+        - Gemfile.lock
+    paths:
+      - vendor/ruby
+      - fresh.env
+  # Cache node_modules likewise
+  - key:
+      files:
+        - yarn.lock
+    paths:
+      - .yarn/cache
 
 # Initialize application env
 before_script:

+ 5 - 0
.yarnrc

@@ -0,0 +1,5 @@
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
+# yarn lockfile v1
+
+--cache-folder .yarn/cache
+disable-self-update-check true