1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-01-06 07:20:30 +00:00

Fix a whole bunch of GH action issues

- Switch over to the Gradle GH action. Not expecting massive changes,
   but might provide some better caching.

 - Bump some GH action versions.

 - Fix a Java 8 compatability issue in our build scripts.
This commit is contained in:
Jonathan Coates 2022-10-22 21:21:33 +01:00
parent b48f590b92
commit 3e3bc8d4b1
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06
3 changed files with 17 additions and 21 deletions

View File

@ -8,20 +8,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Clone repository
uses: actions/checkout@v3
- name: Set up Java 8
uses: actions/setup-java@v1
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: 8
distribution: 'temurin'
- name: Cache Gradle dependencies
uses: actions/cache@v2
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
cache-read-only: ${{ !startsWith(github.ref, 'refs/heads/mc-') }}
- name: Disable Gradle daemon
run: |

View File

@ -11,23 +11,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Clone repository
uses: actions/checkout@v3
- name: Set up Java 8
- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: 8
distribution: 'temurin'
- name: Cache gradle dependencies
uses: actions/cache@v2
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Setup node
run: npm ci
cache-read-only: ${{ !startsWith(github.ref, 'refs/heads/mc-') }}
- name: Build with Gradle
run: ./gradlew compileJava --no-daemon || ./gradlew compileJava --no-daemon

View File

@ -4,6 +4,7 @@ import org.codehaus.groovy.runtime.ProcessGroovyMethods
import java.io.BufferedReader
import java.io.IOException
import java.io.InputStreamReader
import java.util.stream.Collectors
internal object ProcessHelpers {
fun startProcess(vararg command: String): Process {
@ -25,7 +26,7 @@ internal object ProcessHelpers {
fun captureLines(process: Process): List<String> {
val out = BufferedReader(InputStreamReader(process.inputStream)).use { reader ->
reader.lines().filter { it.isNotEmpty() }.toList()
reader.lines().filter { it.isNotEmpty() }.collect(Collectors.toList())
}
ProcessGroovyMethods.closeStreams(process)
if (process.waitFor() != 0) throw IOException("Command exited with a non-0 status")