-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (68 loc) · 2.68 KB
/
Copy pathmain.yml
File metadata and controls
79 lines (68 loc) · 2.68 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
name: Main
# Runs only on push to main (i.e. when a PR is merged or someone pushes
# directly). This is where the full forward-compat JDK matrix runs and
# where we publish the canonical coverage snapshot that Codecov uses as
# the base for PR diffs.
on:
push:
branches: ['main']
permissions:
contents: read
# Don't cancel main runs against each other — we want every merge to
# produce a coverage baseline. Sequential is fine; main pushes are rare.
concurrency:
group: main
cancel-in-progress: false
jobs:
verify:
name: Verify (JDK ${{ matrix.java }})
runs-on: ubuntu-latest
strategy:
# Don't cancel siblings: if JDK 21 fails, we still want to know
# whether 17 and 25 pass.
fail-fast: false
matrix:
# ADR-002: tests run on JDK 17, 21, 25 to catch forward-compat
# regressions. Compilation is always pinned to --release 17.
java: ['17', '21', '25']
steps:
- name: Checkout
uses: actions/checkout@v4
# Install both JDK 17 (for compilation) and the matrix JDK (for
# test execution). setup-java exports JAVA_HOME_<version>_<arch>;
# Gradle's toolchain auto-detection picks them up.
- name: Set up JDKs (compile=17, test=${{ matrix.java }})
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: |
17
${{ matrix.java }}
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build, test, lint, coverage
run: ./gradlew build -PtestJdk=${{ matrix.java }} --stacktrace
- name: Upload test reports on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-reports-jdk${{ matrix.java }}
path: |
build/reports/tests/
build/test-results/
retention-days: 14
# The JDK 17 entry of the matrix is the canonical run for coverage:
# its JaCoCo XML is uploaded to Codecov and becomes the base that
# subsequent PR runs compare against (see codecov.yml).
- name: Upload coverage to Codecov (JDK 17 only)
if: success() && matrix.java == '17'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: build/reports/jacoco/test/jacocoTestReport.xml
fail_ci_if_error: true
# Integration-tests job is intentionally not wired up yet:
# SDK requirements §13 says they run on PRs and release pipelines, but
# they hit the live API and require a MARKETDATA_TOKEN secret. Add this
# job (gated on `if: ${{ secrets.MARKETDATA_TOKEN != '' }}`) once the
# token is configured in the repo's GitHub Actions secrets.