From f6238067fd651925f8fb77d4a64340ab957bd24e Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Fri, 13 Dec 2024 03:10:28 +0100 Subject: [PATCH] Update workflows --- .forgejo/workflows/commit.yml | 194 +++++++++++------------------ .forgejo/workflows/pullrequest.yml | 60 --------- 2 files changed, 73 insertions(+), 181 deletions(-) delete mode 100644 .forgejo/workflows/pullrequest.yml diff --git a/.forgejo/workflows/commit.yml b/.forgejo/workflows/commit.yml index 5a7995e..b1470b2 100644 --- a/.forgejo/workflows/commit.yml +++ b/.forgejo/workflows/commit.yml @@ -1,125 +1,77 @@ -name: build-and-test +name: "PRs & Pushes" on: - - pull_request - - push + - push + - pull_request jobs: - build: - runs-on: docker - container: - image: git.staropensource.de/infrastructure/actions-docker:java - steps: - - name: Checkout - uses: https://code.forgejo.org/actions/checkout@v4 - - 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 }}- - - name: Compile - run: ./gradlew --no-daemon jar javadocJar sourceJar - - 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 }}- - - 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: - image: git.staropensource.de/infrastructure/actions-docker:java - steps: - - name: Checkout - uses: https://code.forgejo.org/actions/checkout@v4 - - 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 }}- - - name: Generate javadoc - run: ./gradlew --no-daemon javadoc javadocAll - - 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 }}- - - 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: - image: git.staropensource.de/infrastructure/actions-docker:java - steps: - - name: Checkout - uses: https://code.forgejo.org/actions/checkout@v4 - - 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 }}- - - name: Run tests - run: ./gradlew --no-daemon test - - 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 }}- + build: + runs-on: docker + container: + image: git.staropensource.de/infrastructure/actions-docker:java + steps: + - name: Checkout + uses: https://code.forgejo.org/actions/checkout@v4 + - 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 }}- + - name: Compile + run: ./gradlew --no-daemon jar + - 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 }}- + - name: Upload JARs + uses: https://code.forgejo.org/forgejo/upload-artifact@v4 + with: + name: jars-libraries + path: | + **/build/libs/*.jar + if-no-files-found: error + build-apidoc: + runs-on: docker + container: + image: git.staropensource.de/infrastructure/actions-docker:java + steps: + - name: Checkout + uses: https://code.forgejo.org/actions/checkout@v4 + - 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 }}- + - name: Compile + run: ./gradlew --no-daemon dokkaHtml dokkaHtmlMultiModule dokkaHtmlJar dokkaJavadocJar + - 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 }}- + - name: Upload JARs + uses: https://code.forgejo.org/forgejo/upload-artifact@v4 + with: + name: jars-libraries + path: | + build/dokka/htmlMultiModule + **/build/dokka/html + **/build/libs/*.jar + if-no-files-found: error diff --git a/.forgejo/workflows/pullrequest.yml b/.forgejo/workflows/pullrequest.yml deleted file mode 100644 index be460e7..0000000 --- a/.forgejo/workflows/pullrequest.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: build-and-test - -on: - - pull_request - -jobs: - generate-javadoc: - runs-on: docker - container: - image: git.staropensource.de/infrastructure/actions-docker:java - steps: - - name: Checkout - uses: https://code.forgejo.org/actions/checkout@v4 - - 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 }}- - - name: Generate javadoc - run: ./gradlew --no-daemon javadoc - - 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 }}- - test: - runs-on: docker - container: - image: git.staropensource.de/infrastructure/actions-docker:java - steps: - - name: Checkout - uses: https://code.forgejo.org/actions/checkout@v4 - - 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 }}- - - name: Run tests - run: ./gradlew --no-daemon test - - 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 }}-