diff --git a/.circleci/config.yml b/.circleci/config.yml index 8ce51066287..26ded949e1a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,6 +13,66 @@ postgres_service: &postgres_service POSTGRES_USER: postgres POSTGRES_DB: circle_database +cache_1: &cache_1 + key: npm-cache-01-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-1 + paths: + - ./node_modules + - ./yarn.lock + - packages/opentelemetry-base/node_modules + - packages/opentelemetry-scope-base/node_modules + - packages/opentelemetry-types/node_modules + - packages/opentelemetry-scope-async-hooks/node_modules + - packages/opentelemetry-core/node_modules + - packages/opentelemetry-exporter-prometheus/node_modules + - packages/opentelemetry-metrics/node_modules + - packages/opentelemetry-tracing/node_modules + - packages/opentelemetry-exporter-jaeger/node_modules + - packages/opentelemetry-exporter-zipkin/node_modules + - packages/opentelemetry-node/node_modules + - packages/opentelemetry-shim-opentracing/node_modules + - packages/opentelemetry-web/node_modules + - packages/opentelemetry-plugin-dns/node_modules + +cache_2: &cache_2 + key: npm-cache-02-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-1 + paths: + - packages/opentelemetry-plugin-grpc/node_modules + - packages/opentelemetry-plugin-http/node_modules + - packages/opentelemetry-plugin-http2/node_modules + - packages/opentelemetry-plugin-mongodb/node_modules + - packages/opentelemetry-plugin-redis/node_modules + - packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg/node_modules + - packages/opentelemetry-plugin-document-load/node_modules + - packages/opentelemetry-plugin-https/node_modules + - packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg-pool/node_modules + - packages/opentelemetry-base/yarn.lock + - packages/opentelemetry-scope-base/yarn.lock + - packages/opentelemetry-types/yarn.lock + - packages/opentelemetry-scope-async-hooks/yarn.lock + - packages/opentelemetry-core/yarn.lock + - packages/opentelemetry-exporter-prometheus/yarn.lock + +cache_3: &cache_3 + key: npm-cache-03-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-1 + paths: + - packages/opentelemetry-metrics/yarn.lock + - packages/opentelemetry-tracing/yarn.lock + - packages/opentelemetry-exporter-jaeger/yarn.lock + - packages/opentelemetry-exporter-zipkin/yarn.lock + - packages/opentelemetry-node/yarn.lock + - packages/opentelemetry-shim-opentracing/yarn.lock + - packages/opentelemetry-web/yarn.lock + - packages/opentelemetry-plugin-dns/yarn.lock + - packages/opentelemetry-plugin-grpc/yarn.lock + - packages/opentelemetry-plugin-http/yarn.lock + - packages/opentelemetry-plugin-http2/yarn.lock + - packages/opentelemetry-plugin-mongodb/yarn.lock + - packages/opentelemetry-plugin-redis/yarn.lock + - packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg/yarn.lock + - packages/opentelemetry-plugin-document-load/yarn.lock + - packages/opentelemetry-plugin-https/yarn.lock + - packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg-pool/yarn.lock + node_unit_tests: &node_unit_tests steps: - checkout @@ -42,62 +102,11 @@ node_unit_tests: &node_unit_tests name: Install Dependencies command: yarn install - save_cache: - key: npm-cache-01-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-1 - paths: - - ./node_modules - - ./yarn.lock - - packages/opentelemetry-base/node_modules - - packages/opentelemetry-scope-base/node_modules - - packages/opentelemetry-types/node_modules - - packages/opentelemetry-scope-async-hooks/node_modules - - packages/opentelemetry-core/node_modules - - packages/opentelemetry-exporter-prometheus/node_modules - - packages/opentelemetry-metrics/node_modules - - packages/opentelemetry-tracing/node_modules - - packages/opentelemetry-exporter-jaeger/node_modules - - packages/opentelemetry-exporter-zipkin/node_modules - - packages/opentelemetry-node/node_modules - - packages/opentelemetry-shim-opentracing/node_modules - - packages/opentelemetry-web/node_modules - - packages/opentelemetry-plugin-dns/node_modules + <<: *cache_1 - save_cache: - key: npm-cache-02-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-1 - paths: - - packages/opentelemetry-plugin-grpc/node_modules - - packages/opentelemetry-plugin-http/node_modules - - packages/opentelemetry-plugin-http2/node_modules - - packages/opentelemetry-plugin-mongodb/node_modules - - packages/opentelemetry-plugin-redis/node_modules - - packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg/node_modules - - packages/opentelemetry-plugin-document-load/node_modules - - packages/opentelemetry-plugin-https/node_modules - - packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg-pool/node_modules - - packages/opentelemetry-base/yarn.lock - - packages/opentelemetry-scope-base/yarn.lock - - packages/opentelemetry-types/yarn.lock - - packages/opentelemetry-scope-async-hooks/yarn.lock - - packages/opentelemetry-core/yarn.lock - - packages/opentelemetry-exporter-prometheus/yarn.lock + <<: *cache_2 - save_cache: - key: npm-cache-03-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-1 - paths: - - packages/opentelemetry-metrics/yarn.lock - - packages/opentelemetry-tracing/yarn.lock - - packages/opentelemetry-exporter-jaeger/yarn.lock - - packages/opentelemetry-exporter-zipkin/yarn.lock - - packages/opentelemetry-node/yarn.lock - - packages/opentelemetry-shim-opentracing/yarn.lock - - packages/opentelemetry-web/yarn.lock - - packages/opentelemetry-plugin-dns/yarn.lock - - packages/opentelemetry-plugin-grpc/yarn.lock - - packages/opentelemetry-plugin-http/yarn.lock - - packages/opentelemetry-plugin-http2/yarn.lock - - packages/opentelemetry-plugin-mongodb/yarn.lock - - packages/opentelemetry-plugin-redis/yarn.lock - - packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg/yarn.lock - - packages/opentelemetry-plugin-document-load/yarn.lock - - packages/opentelemetry-plugin-https/yarn.lock - - packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg-pool/yarn.lock + <<: *cache_3 - run: name: Compile code command: yarn compile @@ -121,9 +130,24 @@ browsers_unit_tests: &browsers_unit_tests command: | node --version echo "CIRCLE_NODE_VERSION=${CIRCLE_NODE_VERSION}" + - restore_cache: + keys: + - npm-cache-01-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-1 + - restore_cache: + keys: + - npm-cache-02-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-1 + - restore_cache: + keys: + - npm-cache-03-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-1 - run: name: Install Dependencies command: yarn install + - save_cache: + <<: *cache_1 + - save_cache: + <<: *cache_2 + - save_cache: + <<: *cache_3 - run: name: Compile code command: yarn compile