mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-01-22 15:06:58 +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:
parent
b48f590b92
commit
3e3bc8d4b1
17
.github/workflows/main-ci.yml
vendored
17
.github/workflows/main-ci.yml
vendored
@ -8,20 +8,19 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
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
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
java-version: 8
|
java-version: 8
|
||||||
|
distribution: 'temurin'
|
||||||
|
|
||||||
- name: Cache Gradle dependencies
|
- name: Setup Gradle
|
||||||
uses: actions/cache@v2
|
uses: gradle/gradle-build-action@v2
|
||||||
with:
|
with:
|
||||||
path: ~/.gradle/caches
|
cache-read-only: ${{ !startsWith(github.ref, 'refs/heads/mc-') }}
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle.properties') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-gradle-
|
|
||||||
|
|
||||||
- name: Disable Gradle daemon
|
- name: Disable Gradle daemon
|
||||||
run: |
|
run: |
|
||||||
|
18
.github/workflows/make-doc.yml
vendored
18
.github/workflows/make-doc.yml
vendored
@ -11,23 +11,19 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
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
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 8
|
java-version: 8
|
||||||
|
distribution: 'temurin'
|
||||||
|
|
||||||
- name: Cache gradle dependencies
|
- name: Setup Gradle
|
||||||
uses: actions/cache@v2
|
uses: gradle/gradle-build-action@v2
|
||||||
with:
|
with:
|
||||||
path: ~/.gradle/caches
|
cache-read-only: ${{ !startsWith(github.ref, 'refs/heads/mc-') }}
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle.properties') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-gradle-
|
|
||||||
|
|
||||||
- name: Setup node
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
run: ./gradlew compileJava --no-daemon || ./gradlew compileJava --no-daemon
|
run: ./gradlew compileJava --no-daemon || ./gradlew compileJava --no-daemon
|
||||||
|
@ -4,6 +4,7 @@ import org.codehaus.groovy.runtime.ProcessGroovyMethods
|
|||||||
import java.io.BufferedReader
|
import java.io.BufferedReader
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.io.InputStreamReader
|
import java.io.InputStreamReader
|
||||||
|
import java.util.stream.Collectors
|
||||||
|
|
||||||
internal object ProcessHelpers {
|
internal object ProcessHelpers {
|
||||||
fun startProcess(vararg command: String): Process {
|
fun startProcess(vararg command: String): Process {
|
||||||
@ -25,7 +26,7 @@ internal object ProcessHelpers {
|
|||||||
|
|
||||||
fun captureLines(process: Process): List<String> {
|
fun captureLines(process: Process): List<String> {
|
||||||
val out = BufferedReader(InputStreamReader(process.inputStream)).use { reader ->
|
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)
|
ProcessGroovyMethods.closeStreams(process)
|
||||||
if (process.waitFor() != 0) throw IOException("Command exited with a non-0 status")
|
if (process.waitFor() != 0) throw IOException("Command exited with a non-0 status")
|
||||||
|
Loading…
Reference in New Issue
Block a user