ci: configure SFTP-Cache for SpraxDev/Action-SpigotMC

This a freshly released feature that should reduce the build times noticeably
This commit is contained in:
Christian Koop 2024-05-09 21:43:40 +02:00
parent 89c3d876ef
commit daffc4bf9e
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
4 changed files with 48 additions and 0 deletions

View File

@ -8,6 +8,21 @@ inputs:
maven_password:
required: false
description: The password to use for the Maven server
spigot_buildtools_sftp_host:
required: false
description: The SFTP host to use for caching the Spigot BuildTools
spigot_buildtools_sftp_port:
required: false
description: The SFTP port to use
spigot_buildtools_sftp_user:
required: false
description: The SFTP user to use
spigot_buildtools_sftp_private_key:
required: false
description: The SFTP private key to use
spigot_buildtools_sftp_host_key:
required: false
description: The SFTP host key to expect
runs:
using: composite
@ -27,6 +42,11 @@ runs:
with:
versions: 1.18.1, 1.18.2, 1.19, 1.19.2, 1.19.3, 1.19.4, 1.20.1, 1.20.2, 1.20.4
remapped: true
sftpCacheHost: ${{ inputs.spigot_buildtools_sftp_host }}
sftpCachePort: ${{ inputs.spigot_buildtools_sftp_port }}
sftpCacheUser: ${{ inputs.spigot_buildtools_sftp_user }}
sftpCachePrivateKey: ${{ inputs.spigot_buildtools_sftp_private_key }}
sftpCacheExpectedHostKey: ${{ inputs.spigot_buildtools_sftp_host_key }}
- uses: actions/setup-java@v4
with:
@ -38,3 +58,8 @@ runs:
with:
versions: 1.20.6
remapped: true
sftpCacheHost: ${{ inputs.spigot_buildtools_sftp_host }}
sftpCachePort: ${{ inputs.spigot_buildtools_sftp_port }}
sftpCacheUser: ${{ inputs.spigot_buildtools_sftp_user }}
sftpCachePrivateKey: ${{ inputs.spigot_buildtools_sftp_private_key }}
sftpCacheExpectedHostKey: ${{ inputs.spigot_buildtools_sftp_host_key }}

View File

@ -22,6 +22,12 @@ jobs:
- uses: actions/checkout@v4
- name: Prepare Workspace
uses: ./.github/actions/setup_project_workspace
with:
spigot_buildtools_sftp_host: ${{ secrets.SPIGOT_BUILDTOOLS_SFTP_HOST }}
spigot_buildtools_sftp_port: ${{ vars.SPIGOT_BUILDTOOLS_SFTP_PORT }}
spigot_buildtools_sftp_user: ${{ secrets.SPIGOT_BUILDTOOLS_SFTP_USER }}
spigot_buildtools_sftp_private_key: ${{ secrets.SPIGOT_BUILDTOOLS_SFTP_PRIVATE_KEY }}
spigot_buildtools_sftp_host_key: ${{ secrets.SPIGOT_BUILDTOOLS_SFTP_HOST_KEY }}
- name: Run tests
run: mvn -B clean test
@ -38,6 +44,11 @@ jobs:
with:
maven_username: ${{ secrets.PLUGINS_MAVEN_REPO_USERNAME }}
maven_password: ${{ secrets.PLUGINS_MAVEN_REPO_PASSWORD }}
spigot_buildtools_sftp_host: ${{ secrets.SPIGOT_BUILDTOOLS_SFTP_HOST }}
spigot_buildtools_sftp_port: ${{ vars.SPIGOT_BUILDTOOLS_SFTP_PORT }}
spigot_buildtools_sftp_user: ${{ secrets.SPIGOT_BUILDTOOLS_SFTP_USER }}
spigot_buildtools_sftp_private_key: ${{ secrets.SPIGOT_BUILDTOOLS_SFTP_PRIVATE_KEY }}
spigot_buildtools_sftp_host_key: ${{ secrets.SPIGOT_BUILDTOOLS_SFTP_HOST_KEY }}
- name: Set project version
uses: craftaro/GH-Commons/.github/actions/maven_set_project_version@master

View File

@ -28,6 +28,12 @@ jobs:
- name: Prepare Workspace
uses: ./.github/actions/setup_project_workspace
with:
spigot_buildtools_sftp_host: ${{ secrets.SPIGOT_BUILDTOOLS_SFTP_HOST }}
spigot_buildtools_sftp_port: ${{ vars.SPIGOT_BUILDTOOLS_SFTP_PORT }}
spigot_buildtools_sftp_user: ${{ secrets.SPIGOT_BUILDTOOLS_SFTP_USER }}
spigot_buildtools_sftp_private_key: ${{ secrets.SPIGOT_BUILDTOOLS_SFTP_PRIVATE_KEY }}
spigot_buildtools_sftp_host_key: ${{ secrets.SPIGOT_BUILDTOOLS_SFTP_HOST_KEY }}
- name: Build with Maven
run: mvn -B -DskipTests clean package

View File

@ -23,6 +23,12 @@ jobs:
- name: Prepare Workspace
uses: ./.github/actions/setup_project_workspace
with:
spigot_buildtools_sftp_host: ${{ secrets.SPIGOT_BUILDTOOLS_SFTP_HOST }}
spigot_buildtools_sftp_port: ${{ vars.SPIGOT_BUILDTOOLS_SFTP_PORT }}
spigot_buildtools_sftp_user: ${{ secrets.SPIGOT_BUILDTOOLS_SFTP_USER }}
spigot_buildtools_sftp_private_key: ${{ secrets.SPIGOT_BUILDTOOLS_SFTP_PRIVATE_KEY }}
spigot_buildtools_sftp_host_key: ${{ secrets.SPIGOT_BUILDTOOLS_SFTP_HOST_KEY }}
- name: 'Cache: SonarCloud'
uses: actions/cache@v4