Skip to content

Build - push

Build - push #616

Workflow file for this run

# 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:
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@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@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@v3.0.2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
javadoc-branch: docs
target-folder: javadoc
java-version: 17
project: maven