.circleci/config.yml in ddtrace-0.43.0 vs .circleci/config.yml in ddtrace-0.44.0

- old
+ new

@@ -1,16 +1,44 @@ version: 2.1 # Common variables, containers, jobs and steps. job_defaults: &job_defaults + # TODO: We should move away from using a directory + # TODO: that requires root permission to be created. + # TODO: Changing this requires rebuilding all docker images. working_directory: /app shell: /bin/bash --login test_containers: + - &job_parameters + parameters: + ruby_version: + description: Ruby version + type: string + image: + description: Docker image location + type: string + jit: + description: Jit enabled? + type: boolean + default: false + - &container_base_environment + BUNDLE_GEMFILE: /app/Gemfile + - &container_parameters_environment + - *container_base_environment + - RUBY_OPT: <<# parameters.jit >>--jit<</ parameters.jit >> + - TEST_DATADOG_INTEGRATION: 1 + - COVERAGE_BASE_DIR: coverage - &container_base + image: <<parameters.image>> environment: - - BUNDLE_GEMFILE=/app/Gemfile + *container_parameters_environment + - &test_job_default + <<: *job_defaults + <<: *job_parameters + docker: + - *container_base - &container_postgres image: postgres:9.6 environment: - POSTGRES_PASSWORD=postgres - POSTGRES_USER=postgres @@ -86,45 +114,17 @@ only: /^v\d+(\.\d+){0,3}(\.(alpha|beta|rc)\d+)?$/ orbs: orb: jobs: - checkout: - <<: *job_defaults - parameters: - ruby_version: - description: Ruby version - type: string - image: - description: Docker image location - type: string - docker: - - <<: *container_base - image: <<parameters.image>> - steps: - - checkout - - save_cache: - key: '{{ .Environment.CIRCLE_CACHE_VERSION }}-repo-<<parameters.ruby_version>>-{{ .Environment.CIRCLE_SHA1 }}' - paths: - - /app build: - <<: *job_defaults - parameters: - ruby_version: - description: Ruby version - type: string - image: - description: Docker image location - type: string - docker: - - <<: *container_base - image: <<parameters.image>> + <<: *test_job_default steps: + - checkout - restore_cache: keys: - '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundled-repo-<<parameters.ruby_version>>-{{ .Environment.CIRCLE_SHA1 }}' - - '{{ .Environment.CIRCLE_CACHE_VERSION }}-repo-<<parameters.ruby_version>>-{{ .Environment.CIRCLE_SHA1 }}' - restore_cache: keys: - bundle-{{ .Environment.CIRCLE_CACHE_VERSION }}-<<parameters.ruby_version>>-{{ checksum "lib/ddtrace/version.rb" }}-{{ .Branch }}-{{ checksum "Gemfile" }}-{{ checksum "Appraisals" }}-{{ checksum "ddtrace.gemspec" }} - bundle-{{ .Environment.CIRCLE_CACHE_VERSION }}-<<parameters.ruby_version>>-{{ checksum "lib/ddtrace/version.rb" }}-{{ .Branch }}- - bundle-{{ .Environment.CIRCLE_CACHE_VERSION }}-<<parameters.ruby_version>>-{{ checksum "lib/ddtrace/version.rb" }} @@ -146,25 +146,13 @@ - save_cache: key: bundle-{{ .Environment.CIRCLE_CACHE_VERSION }}-<<parameters.ruby_version>>-{{ checksum "lib/ddtrace/version.rb" }}-{{ .Branch }}-{{ checksum "Gemfile" }}-{{ checksum "Appraisals" }}-{{ checksum "ddtrace.gemspec" }}-{{ checksum ".circleci/bundle_checksum" }}' paths: - /usr/local/bundle test: - <<: *job_defaults - parameters: - ruby_version: - description: Ruby version - type: string - image: - description: Docker image location - type: string + <<: *test_job_default docker: - <<: *container_base - image: <<parameters.image>> - environment: - - BUNDLE_GEMFILE: /app/Gemfile - - TEST_DATADOG_INTEGRATION: 1 - - COVERAGE_BASE_DIR: coverage - *container_postgres - *container_presto - *container_mysql - *container_elasticsearch - *container_redis @@ -188,24 +176,13 @@ - persist_to_workspace: root: . paths: - coverage benchmark: - <<: *job_defaults - parameters: - ruby_version: - description: Ruby version - type: string - image: - description: Docker image location - type: string + <<: *test_job_default docker: - <<: *container_base - image: <<parameters.image>> - environment: - - BUNDLE_GEMFILE: /app/Gemfile - - TEST_DATADOG_INTEGRATION: 1 - *container_postgres - *container_redis - *container_agent steps: - restore_cache: @@ -219,71 +196,71 @@ command: bundle exec appraisal rails5-postgres-sidekiq ruby benchmarks/sidekiq_test.rb 2>&1 1> /dev/null | tee benchmark_results.csv - run: name: Run Benchmark without ddtracer command: rm -f lib/ddtrace.rb && bundle exec appraisal rails5-postgres-sidekiq ruby benchmarks/sidekiq_test.rb 2>&1 1> /dev/null | tee benchmark_results.csv lint: - <<: *job_defaults - parameters: - ruby_version: - description: Ruby version - type: string - image: - description: Docker image location - type: string - docker: - - <<: *container_base - image: <<parameters.image>> - environment: - - BUNDLE_GEMFILE: /app/Gemfile + <<: *test_job_default steps: - restore_cache: keys: - '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundled-repo-<<parameters.ruby_version>>-{{ .Environment.CIRCLE_SHA1 }}' - restore_cache: keys: - '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundle-<<parameters.ruby_version>>-{{ checksum ".circleci/bundle_checksum" }}' - *step_rubocop coverage: - <<: *job_defaults - parameters: - ruby_version: - description: Ruby version - type: string - image: - description: Docker image location - type: string - docker: - - <<: *container_base - image: <<parameters.image>> - environment: - - BUNDLE_GEMFILE: /app/Gemfile + <<: *test_job_default steps: - restore_cache: keys: - '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundled-repo-<<parameters.ruby_version>>-{{ .Environment.CIRCLE_SHA1 }}' - restore_cache: keys: - '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundle-<<parameters.ruby_version>>-{{ checksum ".circleci/bundle_checksum" }}' - attach_workspace: at: /tmp/workspace - run: + name: Install codecov + command: bundle add codecov + - run: name: Generate coverage report artifact "coverage/index.html" command: COVERAGE_DIR=/tmp/workspace/coverage bundle exec rake coverage:report - run: name: Generate coverage report artifact "coverage/versions/*/index.html" command: COVERAGE_DIR=/tmp/workspace/coverage bundle exec rake coverage:report_per_ruby_version - store_artifacts: path: /tmp/workspace/coverage/report/ destination: coverage + changelog: + <<: *test_job_default + steps: + - restore_cache: + keys: + - '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundled-repo-<<parameters.ruby_version>>-{{ .Environment.CIRCLE_SHA1 }}' + - restore_cache: + keys: + - '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundle-<<parameters.ruby_version>>-{{ checksum ".circleci/bundle_checksum" }}' + - attach_workspace: + at: /tmp/workspace + - run: + name: Format changelog + command: bundle exec rake changelog:format + - run: + name: Check if changelog was unformatted + command: | + if ! git diff-files --quiet; then + echo "Please run 'bundle exec rake changelog:format' and commit the results." + fi commands: executors: jobs: "deploy release": <<: *job_defaults docker: - - <<: *container_base + - environment: + *container_base_environment image: marcotc/docker-library:ddtrace_rb_2_5_6 steps: - checkout - run: name: Install AWS CLI @@ -299,11 +276,12 @@ path: pkg/ destination: gem "deploy prerelease Gem": <<: *job_defaults docker: - - <<: *container_base + - environment: + *container_base_environment image: marcotc/docker-library:ddtrace_rb_2_5_6 steps: - run: name: Check if this commit author has publishing credentials command: | @@ -365,10 +343,19 @@ image: marcotc/docker-library:ddtrace_rb_2_6_4 - &config-2_7 <<: *filters_all_branches_and_tags ruby_version: '2.7' image: marcotc/docker-library:ddtrace_rb_2_7_0 + - &config-3_0 + <<: *filters_all_branches_and_tags + ruby_version: '3.0' + image: marcotc/docker-library:ddtrace_rb_3.0.0 + - &config-3_0-jit + <<: *filters_all_branches_and_tags + ruby_version: '3.0' + image: marcotc/docker-library:ddtrace_rb_3.0.0 + jit: true # JRuby - &config-jruby-9_2 <<: *filters_all_branches_and_tags ruby_version: 'jruby-9.2' image: marcotc/docker-library:ddtrace_rb_jruby_9_2 @@ -392,130 +379,110 @@ - test-2.3 - test-2.4 - test-2.5 - test-2.6 - test-2.7 + - test-3.0 - test-jruby-9.2 + - orb/changelog: + <<: *config-2_7 + name: changelog + requires: + - build-2.7 + filters: + branches: + only: /bump_to_version_.*/ # MRI - - orb/checkout: - <<: *config-2_0 - name: checkout-2.0 - orb/build: <<: *config-2_0 name: build-2.0 - requires: - - checkout-2.0 - orb/test: <<: *config-2_0 name: test-2.0 requires: - build-2.0 - - orb/checkout: - <<: *config-2_1 - name: checkout-2.1 - orb/build: <<: *config-2_1 name: build-2.1 - requires: - - checkout-2.1 - orb/test: <<: *config-2_1 name: test-2.1 requires: - build-2.1 - - orb/checkout: - <<: *config-2_2 - name: checkout-2.2 - orb/build: <<: *config-2_2 name: build-2.2 - requires: - - checkout-2.2 - orb/test: <<: *config-2_2 name: test-2.2 requires: - build-2.2 - - orb/checkout: - <<: *config-2_3 - name: checkout-2.3 - orb/build: <<: *config-2_3 name: build-2.3 - requires: - - checkout-2.3 - orb/test: <<: *config-2_3 name: test-2.3 requires: - build-2.3 - orb/benchmark: <<: *config-2_3 name: benchmark-2.3 requires: - build-2.3 - - orb/checkout: - <<: *config-2_4 - name: checkout-2.4 - orb/build: <<: *config-2_4 name: build-2.4 - requires: - - checkout-2.4 - orb/test: <<: *config-2_4 name: test-2.4 requires: - build-2.4 - - orb/checkout: - <<: *config-2_5 - name: checkout-2.5 - orb/build: <<: *config-2_5 name: build-2.5 - requires: - - checkout-2.5 - orb/test: <<: *config-2_5 name: test-2.5 requires: - build-2.5 - - orb/checkout: - <<: *config-2_6 - name: checkout-2.6 - orb/build: <<: *config-2_6 name: build-2.6 - requires: - - checkout-2.6 - orb/test: <<: *config-2_6 name: test-2.6 requires: - build-2.6 - - orb/checkout: - <<: *config-2_7 - name: checkout-2.7 - orb/build: <<: *config-2_7 name: build-2.7 - requires: - - checkout-2.7 - orb/test: <<: *config-2_7 name: test-2.7 requires: - build-2.7 + - orb/build: + <<: *config-3_0 + name: build-3.0 + - orb/test: + <<: *config-3_0 + name: test-3.0 + requires: + - build-3.0 + - orb/build: + <<: *config-3_0-jit + name: build-3.0-jit + - orb/test: + <<: *config-3_0-jit + name: test-3.0-jit + requires: + - build-3.0-jit # JRuby - - orb/checkout: - <<: *config-jruby-9_2 - name: checkout-jruby-9.2 - orb/build: <<: *config-jruby-9_2 name: build-jruby-9.2 - requires: - - checkout-jruby-9.2 - orb/test: <<: *config-jruby-9_2 name: test-jruby-9.2 requires: - build-jruby-9.2 @@ -530,10 +497,12 @@ - test-2.3 - test-2.4 - test-2.5 - test-2.6 - test-2.7 + - test-3.0 + - test-3.0-jit - test-jruby-9.2 - "deploy release": <<: *filters_only_release_tags requires: - lint @@ -543,6 +512,8 @@ - test-2.3 - test-2.4 - test-2.5 - test-2.6 - test-2.7 + - test-3.0 + - test-3.0-jit - test-jruby-9.2