Skip to content

Commit

Permalink
ci: configure SFTP-Cache for SpraxDev/Action-SpigotMC
Browse files Browse the repository at this point in the history
This a freshly released feature that should reduce the build times noticeably
  • Loading branch information
SpraxDev committed May 9, 2024
1 parent 89c3d87 commit daffc4b
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/actions/setup_project_workspace/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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 }}
11 changes: 11 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit daffc4b

Please sign in to comment.