.gitea/workflows/gradle-ci.yml aktualisiert
Some checks are pending
Gradle CI with Jacoco and Error Logs / build (push) Has started running

This commit is contained in:
Jan
2025-12-07 13:34:05 +01:00
parent 954a28f678
commit 9f06c9f566

View File

@@ -1,37 +1,45 @@
name: Gradle CI with Jacoco name: Gradle CI with Jacoco and Error Logs
on: on:
push: push:
branches: branches: [ main ]
- main
pull_request: pull_request:
branches: branches: [ main ]
- main
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Set up JDK 17 - name: Set up Java 17
uses: actions/setup-java@v3 uses: actions/setup-java@v3
with: with:
distribution: temurin distribution: temurin
java-version: 17 java-version: 17
cache: gradle cache: gradle
- name: Cache Gradle Wrapper Distributions - name: Cache Gradle Wrapper
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: ~/.gradle/wrapper/dists path: ~/.gradle/wrapper/dists
key: gradle-wrapper-${{ runner.os }}-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} key: gradle-wrapper-${{ runner.os }}-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Build & Test with Jacoco
run: ./gradlew --no-daemon test jacocoTestReport
# -----------------------
# Build & Test mit Error-Log
# -----------------------
- name: Build & Test with Jacoco
run: |
mkdir -p build/logs
./gradlew --no-daemon test jacocoTestReport > build/logs/build.log 2>&1 || exit 1
continue-on-error: true
# -----------------------
# Artefakte hochladen
# -----------------------
- name: Upload Jacoco HTML Report - name: Upload Jacoco HTML Report
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
@@ -49,3 +57,10 @@ jobs:
with: with:
name: jacoco-csv-report name: jacoco-csv-report
path: build/reports/jacoco/jacoco.csv path: build/reports/jacoco/jacoco.csv
- name: Upload Build Error Log
if: failure() || always()
uses: actions/upload-artifact@v3
with:
name: build-error-log
path: build/logs/build.log