379 lines
8.5 KiB
YAML
379 lines
8.5 KiB
YAML
version: 2.1
|
|
|
|
defaults: &defaults
|
|
working_directory: ~/dd-trace-java
|
|
resource_class: xlarge
|
|
docker:
|
|
- image: &default_container datadog/dd-trace-java-docker-build:latest
|
|
environment:
|
|
JAVA_HOME: /usr/local/openjdk-11
|
|
|
|
cache_keys: &cache_keys
|
|
keys:
|
|
# Rev the version when the cache gets too big
|
|
- trace-java-v1-{{ .Branch }}-{{ .Revision }}
|
|
- trace-java-v1-{{ .Branch }}
|
|
# - dd-trace-java-v1-
|
|
|
|
jobs:
|
|
build:
|
|
<<: *defaults
|
|
|
|
steps:
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
<<: *cache_keys
|
|
|
|
- run:
|
|
name: Build Project
|
|
command: GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx1G -Xms64M' -Dota.forkedMaxHeapSize=1G -Dota.forkedMinHeapSize=64M" ./gradlew clean compileTestGroovy compileLatestDepTestGroovy compileTestScala compileLatestDepTestScala compileTestJava compileLatestDepTestJava :opentelemetry-auto:shadowJar :auto-exporters:opentelemetry-auto-exporters-jaeger:shadowJar :auto-exporters:opentelemetry-auto-exporters-otlp:shadowJar :auto-exporters:opentelemetry-auto-exporters-logging:shadowJar :auto-exporters:opentelemetry-auto-exporters-zipkin:shadowJar --build-cache --parallel --stacktrace --no-daemon --max-workers=8
|
|
|
|
- run:
|
|
name: Collect Libs
|
|
when: always
|
|
command: .circleci/collect_libs.sh
|
|
|
|
- store_artifacts:
|
|
path: ./libs
|
|
|
|
- persist_to_workspace:
|
|
root: .
|
|
paths:
|
|
- .gradle
|
|
- workspace
|
|
|
|
- save_cache:
|
|
key: trace-java-v1-{{ .Branch }}-{{ .Revision }}
|
|
paths: ~/.gradle
|
|
|
|
|
|
default_test_job: &default_test_job
|
|
<<: *defaults
|
|
|
|
docker:
|
|
- image: *default_container
|
|
environment:
|
|
JAVA_HOME: /usr/local/openjdk-11
|
|
# This is used by spymemcached instrumentation tests
|
|
- image: memcached
|
|
# This is used by rabbitmq instrumentation tests
|
|
- image: rabbitmq
|
|
|
|
steps:
|
|
- checkout
|
|
|
|
- attach_workspace:
|
|
at: .
|
|
|
|
- restore_cache:
|
|
<<: *cache_keys
|
|
|
|
- run:
|
|
name: Run Tests
|
|
command: GRADLE_OPTS="-Dota.forkedMaxHeapSize=4G -Dota.forkedMinHeapSize=64M" ./gradlew $TEST_TASK --build-cache --parallel --stacktrace --no-daemon --max-workers=6
|
|
|
|
- run:
|
|
name: Collect Reports
|
|
when: on_fail
|
|
command: .circleci/collect_reports.sh
|
|
|
|
- store_artifacts:
|
|
path: ./reports
|
|
|
|
- run:
|
|
name: Collect Test Results
|
|
when: always
|
|
command: .circleci/collect_results.sh
|
|
|
|
- store_test_results:
|
|
path: ./results
|
|
|
|
test_7:
|
|
<<: *default_test_job
|
|
environment:
|
|
- TEST_TASK: testJava7
|
|
|
|
test_8:
|
|
<<: *default_test_job
|
|
environment:
|
|
- TEST_TASK: testJava8
|
|
|
|
test_latest:
|
|
<<: *default_test_job
|
|
environment:
|
|
- TEST_TASK: latestDepTest
|
|
|
|
test_ibm8:
|
|
<<: *default_test_job
|
|
environment:
|
|
- TEST_TASK: testJavaIBM8
|
|
|
|
test_zulu8:
|
|
<<: *default_test_job
|
|
environment:
|
|
- TEST_TASK: testJavaZULU8
|
|
|
|
test_11:
|
|
<<: *default_test_job
|
|
environment:
|
|
- TEST_TASK: testJava11 jacocoTestReport jacocoTestCoverageVerification
|
|
|
|
test_zulu11:
|
|
<<: *default_test_job
|
|
environment:
|
|
- TEST_TASK: testJavaZULU11
|
|
|
|
test_12:
|
|
<<: *default_test_job
|
|
environment:
|
|
- TEST_TASK: testJava12
|
|
|
|
test_13:
|
|
<<: *default_test_job
|
|
environment:
|
|
- TEST_TASK: testJava13
|
|
|
|
test_zulu13:
|
|
<<: *default_test_job
|
|
environment:
|
|
- TEST_TASK: testJavaZULU13
|
|
|
|
test_14:
|
|
<<: *default_test_job
|
|
environment:
|
|
- TEST_TASK: testJava14
|
|
|
|
test_zulu14:
|
|
<<: *default_test_job
|
|
environment:
|
|
- TEST_TASK: testJavaZULU14
|
|
|
|
check:
|
|
<<: *defaults
|
|
|
|
steps:
|
|
- checkout
|
|
|
|
- attach_workspace:
|
|
at: .
|
|
|
|
- restore_cache:
|
|
<<: *cache_keys
|
|
|
|
- run:
|
|
name: Build Project
|
|
command: GRADLE_OPTS="-Dota.forkedMaxHeapSize=4G -Dota.forkedMinHeapSize=64M" ./gradlew build -PskipTests --build-cache --parallel --stacktrace --no-daemon --max-workers=8
|
|
|
|
- run:
|
|
name: Collect Reports
|
|
when: always
|
|
command: .circleci/collect_reports.sh
|
|
|
|
- store_artifacts:
|
|
path: ./reports
|
|
|
|
muzzle:
|
|
<<: *defaults
|
|
steps:
|
|
- checkout
|
|
|
|
# We are not running with a cache here because it gets very big and ends up taking more time
|
|
# restoring/saving than the actual increase in time it takes just downloading the artifacts each time.
|
|
|
|
- run:
|
|
name: Verify Muzzle
|
|
command: SKIP_BUILDSCAN="true" GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx4G -Xms64M' -Dota.forkedMaxHeapSize=4G -Dota.forkedMinHeapSize=64M" ./gradlew muzzle --parallel --stacktrace --no-daemon --max-workers=16
|
|
|
|
publish: &publish
|
|
<<: *defaults
|
|
steps:
|
|
- checkout
|
|
|
|
- attach_workspace:
|
|
at: .
|
|
|
|
- restore_cache:
|
|
<<: *cache_keys
|
|
|
|
- deploy:
|
|
name: Publish master to Artifactory
|
|
command: |
|
|
./gradlew \
|
|
-PbuildInfo.build.number=${CIRCLE_BUILD_NUM} \
|
|
snapshot --max-workers=1 --build-cache --stacktrace --no-daemon
|
|
|
|
publish_master:
|
|
<<: *publish
|
|
|
|
release:
|
|
<<: *defaults
|
|
steps:
|
|
- checkout
|
|
|
|
- attach_workspace:
|
|
at: .
|
|
|
|
- restore_cache:
|
|
<<: *cache_keys
|
|
|
|
- run: ./gradlew -Prelease.useLastTag=true final
|
|
|
|
patch_release:
|
|
<<: *defaults
|
|
steps:
|
|
- checkout
|
|
- run: |
|
|
if [[ $(git tag --points-at HEAD | grep "^v") ]]; then
|
|
echo "Don't make patch release on commit which already has version tag"
|
|
circleci-agent step halt
|
|
fi
|
|
|
|
- attach_workspace:
|
|
at: .
|
|
|
|
- restore_cache:
|
|
<<: *cache_keys
|
|
|
|
- run: ./gradlew -Prelease.scope=patch final
|
|
|
|
|
|
workflows:
|
|
version: 2
|
|
build_test_deploy:
|
|
jobs:
|
|
- build:
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
- test_7:
|
|
requires:
|
|
- build
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
- test_8:
|
|
requires:
|
|
- build
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
- test_latest:
|
|
requires:
|
|
- build
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
- test_11:
|
|
requires:
|
|
- build
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
- test_14:
|
|
requires:
|
|
- build
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
|
|
- check:
|
|
requires:
|
|
- build
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
|
|
- muzzle:
|
|
requires:
|
|
- build
|
|
filters:
|
|
branches:
|
|
ignore: master
|
|
|
|
- publish_master:
|
|
requires:
|
|
- test_7
|
|
- test_8
|
|
- test_latest
|
|
- test_11
|
|
- test_14
|
|
- check
|
|
filters:
|
|
branches:
|
|
only: master
|
|
tags:
|
|
ignore: /.*/
|
|
|
|
nightly_snapshot:
|
|
triggers:
|
|
- schedule:
|
|
cron: "0 0 * * *"
|
|
filters:
|
|
branches:
|
|
only:
|
|
- depends-on-otel-java-snapshot
|
|
jobs:
|
|
- test_11
|
|
release:
|
|
jobs:
|
|
- release:
|
|
filters:
|
|
branches:
|
|
ignore: /.*/
|
|
tags:
|
|
# Only for major and minor releases
|
|
only: /^v.*\.0$/
|
|
patch_release:
|
|
jobs:
|
|
- build:
|
|
filters:
|
|
branches:
|
|
only: /\d+\.\d+\.x$/
|
|
- test_7:
|
|
filters:
|
|
branches:
|
|
only: /\d+\.\d+\.x$/
|
|
requires:
|
|
- build
|
|
- test_8:
|
|
filters:
|
|
branches:
|
|
only: /\d+\.\d+\.x$/
|
|
requires:
|
|
- build
|
|
- test_11:
|
|
filters:
|
|
branches:
|
|
only: /\d+\.\d+\.x$/
|
|
requires:
|
|
- build
|
|
- test_14:
|
|
filters:
|
|
branches:
|
|
only: /\d+\.\d+\.x$/
|
|
requires:
|
|
- build
|
|
- check:
|
|
filters:
|
|
branches:
|
|
only: /\d+\.\d+\.x$/
|
|
requires:
|
|
- build
|
|
- muzzle:
|
|
filters:
|
|
branches:
|
|
only: /\d+\.\d+\.x$/
|
|
requires:
|
|
- build
|
|
- patch_release:
|
|
requires:
|
|
- test_7
|
|
- test_11
|
|
- test_14
|
|
- check
|
|
- muzzle
|
|
filters:
|
|
branches:
|
|
only: /\d+\.\d+\.x$/
|