Merge branch 'develop' into bugfix/standalone-loading #273
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and test | |
on: | |
push: | |
branches: | |
- '**' | |
jobs: | |
validate: | |
name: Validate Gradle wrapper | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
jdk: [ 11, 17 ] | |
runs-on: ${{ matrix.os }} | |
env: | |
JDK_VERSION: ${{ matrix.jdk }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Checkout badges branch dedicated to storing badges only | |
uses: actions/checkout@v4 | |
with: | |
ref: badges | |
path: badges | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ matrix.jdk }} | |
distribution: 'temurin' | |
- name: Run the Gradle package task | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: build check | |
- name: Generate coverage badges | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.jdk == '11' }} | |
uses: cicirello/jacoco-badge-generator@v2 | |
with: | |
badges-directory: badges | |
generate-coverage-badge: true | |
generate-branches-badge: true | |
coverage-badge-filename: line-coverage.svg | |
branches-badge-filename: branches-coverage.svg | |
generate-summary: true | |
coverage-label: line coverage | |
branches-label: branch coverage | |
jacoco-csv-file: build/reports/jacoco/test/jacocoTestReport.csv | |
- name: Commit and push | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.jdk == '11' && github.event_name != 'pull_request' }} | |
run: | | |
cd badges | |
if [[ `git status --porcelain *.svg` ]]; then | |
git config --global user.name 'github-actions' | |
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
git add *.svg | |
git commit -m "Autogenerated JaCoCo coverage badge" *.svg | |
git push | |
fi | |
- name: Upload Jacoco coverage report | |
uses: actions/upload-artifact@v3 | |
with: | |
name: jacoco-report | |
path: build/reports/jacoco/ | |
archive: | |
name: Archive job results | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 11 | |
distribution: 'temurin' | |
- name: Run the Gradle package task | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: jar shadowjar | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jars | |
path: | | |
build/libs/*.jar |