ci.yml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. name: CI build
  2. on:
  3. push:
  4. branches:
  5. - main
  6. - v[0-9]+.[0-9]+.x
  7. workflow_dispatch:
  8. jobs:
  9. build:
  10. uses: ./.github/workflows/build.yml
  11. secrets:
  12. GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
  13. GE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  14. GE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  15. test:
  16. uses: ./.github/workflows/test.yml
  17. secrets:
  18. GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
  19. GE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  20. GE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  21. testLatestDeps:
  22. # release branches are excluded
  23. # because any time a new library version is released to maven central it can fail
  24. # which requires unnecessary release branch maintenance, especially for patches
  25. if: ${{ !startsWith(github.ref_name, 'v') }}
  26. uses: ./.github/workflows/test-latest-deps.yml
  27. secrets:
  28. GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
  29. GE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  30. GE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  31. smoke-test:
  32. uses: ./.github/workflows/smoke-test.yml
  33. secrets:
  34. GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
  35. GE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
  36. GE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
  37. muzzle:
  38. # release branches are excluded
  39. # because any time a new library version is released to maven central it can fail
  40. # which requires unnecessary release branch maintenance, especially for patches
  41. if: ${{ !startsWith(github.ref_name, 'v') }}
  42. uses: ./.github/workflows/muzzle.yml
  43. examples:
  44. uses: ./.github/workflows/examples.yml
  45. markdown-link-check:
  46. runs-on: ubuntu-latest
  47. steps:
  48. - uses: actions/checkout@v3
  49. - name: Check markdown links
  50. # using retry because of sporadic external site failures
  51. uses: nick-invision/retry@v2.6.0
  52. with:
  53. # timing out has not been a problem
  54. timeout_minutes: 15
  55. # give external site some time to hopefully recover
  56. retry_wait_seconds: 120
  57. max_attempts: 5
  58. command: |
  59. npm install -g markdown-link-check
  60. find . -type f \
  61. -name '*.md' \
  62. -not -path './.github/*' \
  63. -not -path './node_modules/*' \
  64. -print0 \
  65. | xargs -0 -n1 markdown-link-check --config .github/scripts/markdown_link_check_config.json
  66. markdown-misspell-check:
  67. runs-on: ubuntu-latest
  68. steps:
  69. - uses: actions/checkout@v3
  70. - name: Check markdown for common misspellings
  71. run: |
  72. curl -L -o ./install-misspell.sh https://git.io/misspell
  73. sh ./install-misspell.sh
  74. ./bin/misspell -error ./**/*
  75. snapshot:
  76. runs-on: ubuntu-latest
  77. # intentionally not blocking snapshot publishing on testLatestDeps
  78. # because any time a new library version is released to maven central
  79. # it can fail due to test code incompatibility with the new library version,
  80. # or due to slight changes in emitted telemetry
  81. #
  82. # also not blocking snapshot publishing on markdown-link-check because links to external urls
  83. # can break at any time
  84. needs: [ build, test, smoke-test, examples, muzzle, markdown-misspell-check ]
  85. if: ${{ github.ref_name == 'main' && github.repository == 'open-telemetry/opentelemetry-java-instrumentation' }}
  86. steps:
  87. - uses: actions/checkout@v3
  88. - name: Set up JDK 11 for running Gradle
  89. uses: actions/setup-java@v2
  90. with:
  91. distribution: temurin
  92. java-version: 11
  93. - name: Build and publish artifact snapshots
  94. env:
  95. GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
  96. SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
  97. SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
  98. GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
  99. GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
  100. uses: gradle/gradle-build-action@v2
  101. with:
  102. arguments: assemble publishToSonatype
  103. - name: Build and publish gradle plugin snapshots
  104. env:
  105. GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
  106. SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
  107. SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
  108. GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
  109. GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
  110. uses: gradle/gradle-build-action@v2
  111. with:
  112. arguments: build publishToSonatype
  113. build-root-directory: gradle-plugins