misc: add CI workflows for PRs and commits (#1)
All checks were successful
build-and-test / test (push) Successful in 1m30s
build-and-test / build (push) Successful in 1m37s
build-and-test / generate-javadoc (push) Successful in 1m45s

Reviewed-on: #1
Co-authored-by: JeremyStarTM <jeremystartm@staropensource.de>
Co-committed-by: JeremyStarTM <jeremystartm@staropensource.de>
This commit is contained in:
JeremyStar™ 2024-08-18 18:25:22 +02:00 committed by JeremyStar™
parent 99e0f77fd1
commit db56c0538a

View file

@ -0,0 +1,71 @@
name: build-and-test
on:
- pull_request
- push
jobs:
build:
runs-on: docker
container:
image: git.staropensource.de/staropensource/actions-docker:java
steps:
- name: Checkout
uses: https://code.forgejo.org/actions/checkout@v4
- name: Compile
run: ./gradlew --no-daemon jar javadocJar sourceJar
- 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/staropensource/actions-docker:java
steps:
- name: Checkout
uses: https://code.forgejo.org/actions/checkout@v4
- name: Generate javadoc
run: ./gradlew --no-daemon javadoc javadocAll
- 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/staropensource/actions-docker:java
steps:
- name: Checkout
uses: https://code.forgejo.org/actions/checkout@v4
- name: Run tests
run: ./gradlew --no-daemon test