-
Notifications
You must be signed in to change notification settings - Fork 11
87 lines (78 loc) · 2.28 KB
/
Copy pathbuild.yml
File metadata and controls
87 lines (78 loc) · 2.28 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
# Build and Test
#
# Description:
# Builds the project and runs unit tests for every supported Java version.
#
# Triggers:
# - pull_request: when a PR targets main
# - push: when code is pushed to main
#
# Notes:
# Builds against Java 17, 21, and 25.
name: Build
run-name: Build - ${{ github.event_name }}
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- 'sdk/**'
- 'sdk-testing/**'
- 'sdk-integration-tests/**'
- 'examples/**'
- 'pom.xml'
push:
branches:
- main
paths:
- 'sdk/**'
- 'sdk-testing/**'
- 'sdk-integration-tests/**'
- 'examples/**'
- 'pom.xml'
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java:
- 17
- 21
- 25
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v5
with:
distribution: corretto
java-version: ${{ matrix.java }}
cache: maven
- name: Build and test
run: mvn -B install --file pom.xml
- name: Generate JaCoCo Badge
if: ${{ github.ref == 'refs/heads/main' && matrix.java == 17 }}
uses: cicirello/jacoco-badge-generator@72266185b7ee48a6fd74eaf0238395cc8b14fef8 # v2
with:
jacoco-csv-file: coverage-report/target/site/jacoco-aggregate/jacoco.csv
badges-directory: coverage-report/target/site/jacoco-aggregate
- name: Publish coverage report to GitHub Pages
if: ${{ github.ref == 'refs/heads/main' && matrix.java == 17 }}
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4
with:
branch: docs
folder: coverage-report/target/site/jacoco-aggregate
target-folder: coverage
- name: Deploy javadoc to Github Pages
if: ${{ github.ref == 'refs/heads/main' && matrix.java == 17 }}
uses: MathieuSoysal/Javadoc-publisher.yml@fda475b197081ba1eca7a1dfadf0c017080a1623 # v3.0.2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
javadoc-branch: docs
target-folder: javadoc
java-version: 17
project: maven