Repository navigation
104 lines (93 loc) · 3.98 KB
/
Copy pathjava-observability.yml
File metadata and controls
104 lines (93 loc) · 3.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: 'Java Observability'
on:
push:
branches: ['main']
paths:
- 'sdk/@launchdarkly/observability-java/**'
- 'e2e/java-plugin/**'
- 'e2e/java-plugin-spring-boot/**'
# Shared sampling scenarios; :lib:checkSamplingFixtures compares them.
- 'go/internal/otel/*-test-scenarios.json'
- '.github/workflows/java-observability.yml'
pull_request:
types: [opened, synchronize]
paths:
- 'sdk/@launchdarkly/observability-java/**'
- 'e2e/java-plugin/**'
- 'e2e/java-plugin-spring-boot/**'
# Shared sampling scenarios; :lib:checkSamplingFixtures compares them.
- 'go/internal/otel/*-test-scenarios.json'
- '.github/workflows/java-observability.yml'
permissions:
contents: read
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
test:
# The library targets Java 11, so it is built and tested on every LTS
# a server might run it on, not only the newest.
name: Unit Tests (JDK ${{ matrix.java }})
runs-on: ubuntu-22.04-8core-32gb
strategy:
fail-fast: false
matrix:
java: [11, 17, 21]
defaults:
run:
working-directory: ./sdk/@launchdarkly/observability-java
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'gradle'
# `build` includes `check`, which runs the unit tests plus the
# runtime-classpath guard (no OkHttp/Okio/Kotlin) and the POM
# guard (opentelemetry-api at compile scope, JDK sender at runtime).
- name: Build, test and verify the published POM
run: ./gradlew :lib:build --no-daemon --console=plain
# The plugin needs the Plugin API, first shipped in SDK 7.10.1.
- name: Test against the oldest supported LaunchDarkly SDK
if: matrix.java == 11
run: ./gradlew :lib:test -PldServerSdkVersion=7.10.1 --no-daemon --console=plain
- name: Upload test reports
if: always()
uses: actions/upload-artifact@v4
with:
name: java-unit-test-results-jdk${{ matrix.java }}
path: sdk/@launchdarkly/observability-java/**/build/test-results/**/TEST-*.xml
retention-days: 7
consumer:
# Builds the e2e example against the artifact as a consumer sees it:
# published to Maven local and resolved through its POM, with no
# composite build to paper over scope or transitive-dependency mistakes.
name: Consumer check (JDK ${{ matrix.java }})
runs-on: ubuntu-22.04-8core-32gb
strategy:
fail-fast: false
matrix:
java: [11, 21]
defaults:
run:
working-directory: ./e2e/java-plugin
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'gradle'
- name: Publish the plugin to Maven local and build the example against it
run: make consumer-check
# Spring Boot 3 needs Java 17, so the web backend is checked as a
# consumer on the newer JDK only.
- name: Build the Spring Boot backend against the Maven local artifact
if: matrix.java != 11
working-directory: ./e2e/java-plugin-spring-boot
run: make consumer-check