From c90379a0d1bb9235c010146aacaa98ba0ad71d8f Mon Sep 17 00:00:00 2001 From: Tobias Nett Date: Sun, 3 Sep 2023 15:12:33 +0200 Subject: [PATCH 1/9] ci(github): Basic Gradle workflow to build on Github --- .github/workflows/build.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000000..9afe160b018 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,20 @@ +name: Java CI + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: '15' + distribution: 'adopt' + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + - name: Execute Gradle Build + run: ./gradlew build From 517990593873d878e9122fb949fbda197c161115 Mon Sep 17 00:00:00 2001 From: Tobias Nett Date: Sun, 3 Sep 2023 15:21:47 +0200 Subject: [PATCH 2/9] fix: use Java 11 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9afe160b018..e946d060591 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: '15' + java-version: '11' distribution: 'adopt' - name: Validate Gradle Wrapper uses: gradle/wrapper-validation-action@v1 From 4dbbba945d76ac11ca8aea9d13df703c2896c211 Mon Sep 17 00:00:00 2001 From: Tobias Nett Date: Sun, 3 Sep 2023 17:20:57 +0200 Subject: [PATCH 3/9] ci(github): split up workflow steps --- .github/workflows/build.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e946d060591..dceb046967f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,5 +16,16 @@ jobs: uses: gradle/wrapper-validation-action@v1 - name: Setup Gradle uses: gradle/gradle-build-action@v2 - - name: Execute Gradle Build - run: ./gradlew build + - name: Build Distribution for Launcher + run: ./gradlew distForLauncher + - name: Unit Tests + run: ./gradlew unitTest + - name: Integration Tests + run: ./gradlew integrationTest + - name: Static Code Analysis + run: ./gradlew check -x test + - name: API Documentation + run: ./gradlew javadoc + - name: Publish + run: echo "TODO" + From 2911d6573eb5d17212c1edd904dc2c193088fb03 Mon Sep 17 00:00:00 2001 From: Tobias Nett Date: Sun, 3 Sep 2023 17:56:22 +0200 Subject: [PATCH 4/9] ci(github): silly attempt on (independent) parallel jobs --- .github/workflows/build.yml | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dceb046967f..eb4a5cb93df 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,12 +20,38 @@ jobs: run: ./gradlew distForLauncher - name: Unit Tests run: ./gradlew unitTest - - name: Integration Tests - run: ./gradlew integrationTest - - name: Static Code Analysis - run: ./gradlew check -x test - name: API Documentation run: ./gradlew javadoc - name: Publish run: echo "TODO" - + integration-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt' + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + - name: Integration Tests + run: ./gradlew integrationTest + code-analysis: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt' + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + - name: Static Code Analysis + run: ./gradlew check -x test + \ No newline at end of file From 5e5235cfd1a8bee1fbf272223174ed61adccf40f Mon Sep 17 00:00:00 2001 From: Tobias Nett Date: Sun, 3 Sep 2023 18:38:32 +0200 Subject: [PATCH 5/9] ci(github): add job with Gradle Build Scan --- .github/workflows/build.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb4a5cb93df..4e7d1865881 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,4 +54,19 @@ jobs: uses: gradle/gradle-build-action@v2 - name: Static Code Analysis run: ./gradlew check -x test + build-with-scan: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt' + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + - name: Build With Gradlew + run: ./gradlew build --scan \ No newline at end of file From 94c12bc195d45d6c4737ab15228e45724aa4bf9d Mon Sep 17 00:00:00 2001 From: Tobias Nett Date: Sun, 3 Sep 2023 18:46:45 +0200 Subject: [PATCH 6/9] fix(build): Don't ignore test failures --- build-logic/src/main/kotlin/terasology-metrics.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-logic/src/main/kotlin/terasology-metrics.gradle.kts b/build-logic/src/main/kotlin/terasology-metrics.gradle.kts index 2c57d92a194..43e694c4c41 100644 --- a/build-logic/src/main/kotlin/terasology-metrics.gradle.kts +++ b/build-logic/src/main/kotlin/terasology-metrics.gradle.kts @@ -45,7 +45,7 @@ tasks.withType { useJUnitPlatform() // ignoreFailures: Specifies whether the build should break when the verifications performed by this task fail. - ignoreFailures = true + ignoreFailures = false // showStandardStreams: makes the standard streams (err and out) visible at console when running tests // If false, the outputs are still collected and visible in the test report, but they don't spam the console. testLogging.showStandardStreams = false From 875497e4156a6caa1c702c493d09485d19865b03 Mon Sep 17 00:00:00 2001 From: Tobias Nett Date: Sun, 3 Sep 2023 19:49:23 +0200 Subject: [PATCH 7/9] programmically accept the Gradle Build Scan terms of service when running in CI --- .github/workflows/build.yml | 2 +- build.gradle | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e7d1865881..151ecd5b35e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,5 +68,5 @@ jobs: - name: Setup Gradle uses: gradle/gradle-build-action@v2 - name: Build With Gradlew - run: ./gradlew build --scan + run: ./gradlew -PacceptGradleBuildScanTermsOfService=yes distForLauncher --scan \ No newline at end of file diff --git a/build.gradle b/build.gradle index 6c4da8f63fc..b3c9559602b 100644 --- a/build.gradle +++ b/build.gradle @@ -282,3 +282,15 @@ idea { cleanIdea.doLast { new File('Terasology.iws').delete() } + +if (hasProperty('buildScan') + // allow to programmically accept the Gradle Build Scan terms of service when running in CI + && project.hasProperty('acceptGradleBuildScanTermsOfService') + && project.acceptGradleBuildScanTermsOfService == 'yes') { + gradleEnterprise { + buildScan { + termsOfServiceUrl = "https://gradle.com/terms-of-service" + termsOfServiceAgree = "yes" + } + } +} From 8cbf314a9fb0af293924814f97a295cb672217f3 Mon Sep 17 00:00:00 2001 From: jdrueckert Date: Sun, 3 Sep 2023 21:53:11 +0200 Subject: [PATCH 8/9] chore: remove superfluous whitespaces --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 151ecd5b35e..de2121dca78 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,5 +68,4 @@ jobs: - name: Setup Gradle uses: gradle/gradle-build-action@v2 - name: Build With Gradlew - run: ./gradlew -PacceptGradleBuildScanTermsOfService=yes distForLauncher --scan - \ No newline at end of file + run: ./gradlew -PacceptGradleBuildScanTermsOfService=yes distForLauncher --scan \ No newline at end of file From cf0d2ae9522188c8b6efba3c21070f88423cab0a Mon Sep 17 00:00:00 2001 From: Tobias Nett Date: Sun, 3 Sep 2023 22:28:00 +0200 Subject: [PATCH 9/9] =?UTF-8?q?run=20extract=E2=80=A6=20tasks=20on=20build?= =?UTF-8?q?=20job?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index de2121dca78..e898918848a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: - name: Setup Gradle uses: gradle/gradle-build-action@v2 - name: Build Distribution for Launcher - run: ./gradlew distForLauncher + run: ./gradlew extractConfig extractNatives distForLauncher testDist - name: Unit Tests run: ./gradlew unitTest - name: API Documentation