ci: Split up test and build steps
This commit is contained in:
27
.github/composite/gradle/action.yml
vendored
Normal file
27
.github/composite/gradle/action.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# SPDX-FileCopyrightText: 2024 Linnea Gräf <nea@nea.moe>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
|
name: "Run Gradle on a filter=tree:0 checkout"
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
name: Checkout repository
|
||||||
|
with:
|
||||||
|
fetch-tags: true
|
||||||
|
fetch-depth: 0
|
||||||
|
filter: 'tree:0'
|
||||||
|
- name: Set up JDK 21
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 21
|
||||||
|
- name: Set up gradle cache
|
||||||
|
uses: gradle/actions/setup-gradle@v3
|
||||||
|
with:
|
||||||
|
add-job-summary-as-pr-comment: 'on-failure'
|
||||||
|
- name: Prepare unpacked Jars
|
||||||
|
run: |
|
||||||
|
./gradlew unpackAllJars
|
||||||
|
shell: sh
|
||||||
33
.github/workflows/build.yml
vendored
33
.github/workflows/build.yml
vendored
@@ -7,9 +7,12 @@ on:
|
|||||||
- push
|
- push
|
||||||
- pull_request
|
- pull_request
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Test
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -18,18 +21,10 @@ jobs:
|
|||||||
fetch-tags: true
|
fetch-tags: true
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
filter: 'tree:0'
|
filter: 'tree:0'
|
||||||
- name: Set up JDK 21
|
- uses: ./.github/composite/gradle
|
||||||
uses: actions/setup-java@v4
|
|
||||||
with:
|
|
||||||
distribution: temurin
|
|
||||||
java-version: 21
|
|
||||||
- name: Set up gradle cache
|
|
||||||
uses: gradle/actions/setup-gradle@v3
|
|
||||||
- name: Build with gradle
|
- name: Build with gradle
|
||||||
run: |
|
run: |
|
||||||
./gradlew clean
|
./gradlew remapJar --scan
|
||||||
./gradlew unpackAllJars --stacktrace
|
|
||||||
./gradlew test remapJar --stacktrace
|
|
||||||
- name: Move build artifact around and print check sum
|
- name: Move build artifact around and print check sum
|
||||||
run: |
|
run: |
|
||||||
rm -f build/libs/*sources*.jar
|
rm -f build/libs/*sources*.jar
|
||||||
@@ -40,6 +35,22 @@ jobs:
|
|||||||
name: built-mod-jar
|
name: built-mod-jar
|
||||||
path: build/libs/Firmament-*.jar
|
path: build/libs/Firmament-*.jar
|
||||||
|
|
||||||
|
test:
|
||||||
|
name: Test
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
name: Checkout repository
|
||||||
|
with:
|
||||||
|
fetch-tags: true
|
||||||
|
fetch-depth: 0
|
||||||
|
filter: 'tree:0'
|
||||||
|
- uses: ./.github/composite/gradle
|
||||||
|
- name: Build with gradle
|
||||||
|
run: |
|
||||||
|
./gradlew test --scan
|
||||||
|
|
||||||
upload:
|
upload:
|
||||||
name: Upload
|
name: Upload
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
Reference in New Issue
Block a user