2023-08-25 04:23:54 +02:00
|
|
|
name: 'Generic: Test'
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
plugin_name:
|
|
|
|
description: 'Plugin name'
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
|
|
|
|
jobs:
|
2024-10-13 04:54:19 +02:00
|
|
|
test-and-artifact:
|
2023-08-25 04:23:54 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- uses: actions/setup-java@v3
|
|
|
|
with:
|
|
|
|
java-version: '11'
|
|
|
|
distribution: 'adopt'
|
|
|
|
cache: gradle
|
|
|
|
|
|
|
|
- name: Validate Gradle wrapper
|
|
|
|
uses: gradle/wrapper-validation-action@v1
|
|
|
|
|
|
|
|
- name: Run unit tests
|
|
|
|
uses: gradle/gradle-build-action@v2
|
|
|
|
with:
|
|
|
|
arguments: build
|
|
|
|
env:
|
|
|
|
GITHUB_VERSION: pr${{ github.event.pull_request.number }}
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Artifact output
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ${{ inputs.plugin_name }}-pr${{ github.event.pull_request.number }}
|
|
|
|
path: build/libs/${{ inputs.plugin_name }}-pr${{ github.event.pull_request.number }}.jar
|
2024-10-13 04:54:19 +02:00
|
|
|
|
|
|
|
comment-artifact:
|
|
|
|
needs: test-and-artifact
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
pull-requests: write
|
|
|
|
steps:
|
|
|
|
- uses: benwoo1110/artifact-comment-action@v1
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|