]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
ci: use workflows
authorEduardo San Martin Morote <posva13@gmail.com>
Fri, 13 Mar 2020 17:24:39 +0000 (18:24 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Fri, 1 May 2020 08:04:36 +0000 (10:04 +0200)
circle.yml

index 2340dfc29719c5dfd2a57d6191b1b90ede955ebb..879e1b88bfa0a61ba1319744e87cc6f9eb54cccc 100644 (file)
@@ -2,40 +2,95 @@
 #
 # Check https://circleci.com/docs/2.0/language-javascript/ for more details
 #
-version: 2
+version: 2.0
 
-jobs:
-  build:
-    docker:
-      - image: circleci/node:lts-browsers
-
-    working_directory: ~/repo
+defaults: &defaults
+  working_directory: ~/project/vue-router
+  docker:
+    - image: circleci/node:lts-browsers
 
+jobs:
+  install:
+    <<: *defaults
     steps:
       - checkout
-
       - restore_cache:
           keys:
-            - dependencies-cache-{{ checksum "yarn.lock" }}
-            # fallback to using the latest cache if no exact match is found
-            - dependencies-cache-
-
+            - v1-dependencies-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
+            - v1-dependencies-cache-{{ .Branch }}-
+            - v1-dependencies-cache-
       - run: yarn install
-
       - save_cache:
+          key: v1-dependencies-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
           paths:
             - node_modules
-          key: dependencies-cache-{{ checksum "yarn.lock" }}
+      - persist_to_workspace:
+          root: ~/project
+          paths:
+            - vue-router
 
-      - run: yarn run lint
-      - run: yarn run test:types
-      - run: yarn run build
-      - run: yarn run build:dts
-      - run: yarn run test:tsd
-      - run: yarn run test:unit --maxWorkers=2
+  build-e2e:
+    <<: *defaults
+    steps:
+      - attach_workspace:
+          at: ~/project
       - run: yarn run build:e2e
-      - run: yarn run test:e2e:ci
+      - store_artifacts:
+          path: e2e/__build__
 
+  test-unit:
+    <<: *defaults
+    steps:
+      - attach_workspace:
+          at: ~/project
+      - run: yarn test:unit  --maxWorkers=2
+      - store_artifacts:
+          path: coverage
+
+  test-e2e:
+    <<: *defaults
+    steps:
+      - attach_workspace:
+          at: ~/project
+      - run: yarn test:e2e
+      - store_artifacts:
+          path: coverage
+
+  build-lint:
+    <<: *defaults
+    steps:
+      - attach_workspace:
+          at: ~/project
+      - run: yarn lint
+      - run: yarn test:types
+      - run: yarn build
+      - run: yarn build:dts
+      - run: yarn run test:tsd
+
+  coverage:
+    <<: *defaults
       - run:
           name: Send code coverage
           command: yarn run codecov
+
+workflows:
+  version: 2
+  install-and-parallel-test:
+    jobs:
+      - install
+      - build-lint:
+          requires:
+            - install
+      - build-e2e:
+          requires:
+            - install
+      - test-unit:
+          requires:
+            - install
+      - test-e2e:
+          requires:
+            - build-e2e
+      - coverage:
+          requires:
+            - build
+            - test-unit