51 lines
1.3 KiB
YAML
51 lines
1.3 KiB
YAML
name: Build & Test
|
|
|
|
on:
|
|
workflow_call:
|
|
outputs:
|
|
artifact-name:
|
|
description: "Uploaded artifact name for downstream jobs"
|
|
value: ${{ jobs.build.outputs.artifact-name }}
|
|
|
|
jobs:
|
|
build:
|
|
name: Build & Test
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
outputs:
|
|
artifact-name: ${{ steps.meta.outputs.artifact-name }}
|
|
steps:
|
|
- name: Checkout source
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up JDK 21
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
distribution: temurin
|
|
java-version: "21"
|
|
cache: gradle
|
|
|
|
- name: Set up Gradle
|
|
uses: gradle/actions/setup-gradle@v6
|
|
|
|
- name: Build
|
|
run: ./gradlew clean bootJar --stacktrace --no-daemon
|
|
|
|
- name: Test
|
|
run: ./gradlew test --stacktrace --no-daemon
|
|
|
|
- name: Set artifact name
|
|
id: meta
|
|
run: echo "artifact-name=build-${{ github.run_id }}-${{ github.run_attempt }}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: ${{ steps.meta.outputs.artifact-name }}
|
|
path: |
|
|
build/libs/*.jar
|
|
build/reports/**
|
|
build/test-results/**
|
|
retention-days: 7
|
|
if-no-files-found: error
|