2024-08-18 18:25:22 +02:00
|
|
|
name: build-and-test
|
|
|
|
|
|
|
|
on:
|
|
|
|
- pull_request
|
|
|
|
- push
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: docker
|
|
|
|
container:
|
2024-11-30 12:56:17 +01:00
|
|
|
image: git.staropensource.de/infrastructure/actions-docker:java
|
2024-08-18 18:25:22 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: https://code.forgejo.org/actions/checkout@v4
|
2024-08-18 20:25:09 +02:00
|
|
|
- name: Restore Gradle cache
|
|
|
|
uses: actions/cache/restore@v4
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
|
|
|
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
|
|
restore-keys: |
|
|
|
|
gradle-${{ runner.os }}-
|
2024-08-18 18:25:22 +02:00
|
|
|
- name: Compile
|
|
|
|
run: ./gradlew --no-daemon jar javadocJar sourceJar
|
2024-08-18 20:25:09 +02:00
|
|
|
- name: Save Gradle cache
|
|
|
|
uses: actions/cache/save@v4
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
|
|
|
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
|
|
restore-keys: |
|
|
|
|
gradle-${{ runner.os }}-
|
2024-08-18 18:25:22 +02:00
|
|
|
- name: Upload library JARs
|
|
|
|
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: jars-libraries
|
|
|
|
path: |
|
|
|
|
**/build/libs/*.jar
|
|
|
|
!**/build/libs/*-javadoc.jar
|
|
|
|
!**/build/libs/*-sources.jar
|
|
|
|
if-no-files-found: error
|
|
|
|
- name: Upload API documentation JARs
|
|
|
|
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: jars-apidocs
|
|
|
|
path: |
|
|
|
|
**/build/libs/*-javadoc.jar
|
|
|
|
if-no-files-found: error
|
|
|
|
- name: Upload source JARs
|
|
|
|
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: jars-sources
|
|
|
|
path: |
|
|
|
|
**/build/libs/*-sources.jar
|
|
|
|
if-no-files-found: error
|
|
|
|
generate-javadoc:
|
|
|
|
runs-on: docker
|
|
|
|
container:
|
2024-11-30 12:56:17 +01:00
|
|
|
image: git.staropensource.de/infrastructure/actions-docker:java
|
2024-08-18 18:25:22 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: https://code.forgejo.org/actions/checkout@v4
|
2024-08-18 20:25:09 +02:00
|
|
|
- name: Restore Gradle cache
|
|
|
|
uses: actions/cache/restore@v4
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
|
|
|
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
|
|
restore-keys: |
|
|
|
|
gradle-${{ runner.os }}-
|
2024-08-18 18:25:22 +02:00
|
|
|
- name: Generate javadoc
|
|
|
|
run: ./gradlew --no-daemon javadoc javadocAll
|
2024-08-18 20:25:09 +02:00
|
|
|
- name: Save Gradle cache
|
|
|
|
uses: actions/cache/save@v4
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
|
|
|
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
|
|
restore-keys: |
|
|
|
|
gradle-${{ runner.os }}-
|
2024-08-18 18:25:22 +02:00
|
|
|
- name: Upload separate javadoc
|
|
|
|
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: javadoc-separate
|
|
|
|
path: |
|
|
|
|
**/build/docs/javadoc/*
|
|
|
|
if-no-files-found: error
|
|
|
|
- name: Upload combined javadoc
|
|
|
|
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: javadoc-combined
|
|
|
|
path: |
|
|
|
|
build/docs/javadoc/*
|
|
|
|
if-no-files-found: error
|
|
|
|
test:
|
|
|
|
runs-on: docker
|
|
|
|
container:
|
2024-11-30 12:56:17 +01:00
|
|
|
image: git.staropensource.de/infrastructure/actions-docker:java
|
2024-08-18 18:25:22 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: https://code.forgejo.org/actions/checkout@v4
|
2024-08-18 20:25:09 +02:00
|
|
|
- name: Restore Gradle cache
|
|
|
|
uses: actions/cache/restore@v4
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
|
|
|
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
|
|
restore-keys: |
|
|
|
|
gradle-${{ runner.os }}-
|
2024-08-18 18:25:22 +02:00
|
|
|
- name: Run tests
|
|
|
|
run: ./gradlew --no-daemon test
|
2024-08-18 20:25:09 +02:00
|
|
|
- name: Save Gradle cache
|
|
|
|
uses: actions/cache/save@v4
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
|
|
|
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
|
|
restore-keys: |
|
|
|
|
gradle-${{ runner.os }}-
|