forked from open-telemetry/opentelemetry-java
-
Notifications
You must be signed in to change notification settings - Fork 2
109 lines (96 loc) · 3.07 KB
/
main-build.yml
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
105
106
107
108
109
name: "Continuous Build"
on:
push:
branches:
- main
- v[0-9]+.[0-9]+.x
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-20.04
test-java-version:
- 8
- 11
- 17
include:
- os: ubuntu-20.04
test-java-version: 17
coverage: true
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: setup-java-8
name: Setup Java 8 for tests
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 8
java-package: jre
- id: setup-java-11
name: Setup Java 11 for tests
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 11
- id: setup-java-17
name: Setup Java 17
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 17
- uses: gradle/gradle-build-action@v2
with:
arguments: |
build
--stacktrace
${{ matrix.coverage && 'jacocoTestReport' || '' }}
-PtestJavaVersion=${{ matrix.test-java-version }}
-Porg.gradle.java.installations.paths=${{ steps.setup-java-8.outputs.path }},${{ steps.setup-java-11.outputs.path }},${{ steps.setup-java-17.outputs.path }}
- uses: codecov/[email protected]
if: ${{ matrix.coverage }}
- uses: actions/upload-artifact@v2
if: ${{ matrix.coverage }}
with:
name: coverage-report
path: all/build/reports/jacoco/test/html
markdown-link-check:
# release branches are excluded to avoid unnecessary maintenance if external links break
if: ${{ !startsWith(github.ref_name, 'v') }}
uses: ./.github/workflows/reusable-markdown-link-check.yml
markdown-misspell-check:
# release branches are excluded to avoid unnecessary maintenance if new misspellings are
# added to the misspell dictionary
if: ${{ !startsWith(github.ref_name, 'v') }}
uses: ./.github/workflows/reusable-misspell-check.yml
publish-snapshots:
name: Publish snapshots
if: ${{ github.event_name == 'push' && github.repository == 'open-telemetry/opentelemetry-java' }}
# snapshot publishing is not dependent on markdown-link-check success, because links to external
# urls can break at any time
needs: build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: setup-java-11
name: Setup Java 11
uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 17
- uses: gradle/gradle-build-action@v2
with:
arguments: snapshot --stacktrace
env:
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}