From 3339d08e114e477529a85abee8caac286ba3e4f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB?= Date: Tue, 5 Dec 2023 19:35:23 -0700 Subject: [PATCH 1/6] Create gradle-build.yml --- .github/workflows/gradle-build.yml | 70 ++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/gradle-build.yml diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml new file mode 100644 index 000000000..462e6dc9d --- /dev/null +++ b/.github/workflows/gradle-build.yml @@ -0,0 +1,70 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created +# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle + +name: Gradle Build + +on: [pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file + + - name: Gradle Wrapper Validation + uses: gradle/wrapper-validation-action@v1.1.0 + + - uses: burrunan/gradle-cache-action@v1 + name: Build PROJECT_NAME + # Extra environment variables for Gradle execution (regular GitHub Actions feature) + # Note: env must be outside of "with" + env: + VARIABLE: VALUE + with: + # Specifies arguments for Gradle execution + # If arguments is missing or empty, then Gradle is not executed + arguments: build + # arguments can be multi-line for better readability + # arguments: | + # --no-paralell + # build + # -x test + # Gradle version to use for execution: + # wrapper (default), current, rc, nightly, release-nightly, or + # versions like 6.6 (see https://services.gradle.org/versions/all) + gradle-version: wrapper + # Properties are passed as -Pname=value + properties: | + kotlin.js.compiler=ir + kotlin.parallel.tasks.in.project=true + +# - name: Build with Gradle +# uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 +# with: +# arguments: build + + # The USERNAME and TOKEN need to correspond to the credentials environment variables used in + # the publishing section of your build.gradle +# - name: Publish to GitHub Packages +# uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 +# with: +# arguments: publish +# env: +# USERNAME: ${{ github.actor }} +# TOKEN: ${{ secrets.GITHUB_TOKEN }} From 601d1747209c6c3db7f7b617e4f3143cf0d5ccf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Tue, 5 Dec 2023 19:43:48 -0700 Subject: [PATCH 2/6] pin versions and remove dead lines --- .github/workflows/gradle-build.yml | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml index 462e6dc9d..73e2253ed 100644 --- a/.github/workflows/gradle-build.yml +++ b/.github/workflows/gradle-build.yml @@ -18,24 +18,17 @@ jobs: packages: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 with: java-version: '17' distribution: 'temurin' server-id: github # Value of the distributionManagement/repository/id field of the pom.xml settings-path: ${{ github.workspace }} # location for the settings.xml file - - - name: Gradle Wrapper Validation - uses: gradle/wrapper-validation-action@v1.1.0 - - uses: burrunan/gradle-cache-action@v1 + - uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6 name: Build PROJECT_NAME - # Extra environment variables for Gradle execution (regular GitHub Actions feature) - # Note: env must be outside of "with" - env: - VARIABLE: VALUE with: # Specifies arguments for Gradle execution # If arguments is missing or empty, then Gradle is not executed @@ -52,19 +45,4 @@ jobs: # Properties are passed as -Pname=value properties: | kotlin.js.compiler=ir - kotlin.parallel.tasks.in.project=true - -# - name: Build with Gradle -# uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 -# with: -# arguments: build - - # The USERNAME and TOKEN need to correspond to the credentials environment variables used in - # the publishing section of your build.gradle -# - name: Publish to GitHub Packages -# uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 -# with: -# arguments: publish -# env: -# USERNAME: ${{ github.actor }} -# TOKEN: ${{ secrets.GITHUB_TOKEN }} + kotlin.parallel.tasks.in.project=true \ No newline at end of file From e4df8dce1d02500c35f4649ec7c7396f42137a4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Tue, 5 Dec 2023 19:52:12 -0700 Subject: [PATCH 3/6] proper gradle cache --- settings.gradle.kts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/settings.gradle.kts b/settings.gradle.kts index 579176985..c5bed6f73 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -39,3 +39,12 @@ pluginManagement { } } } + +// settings.gradle.kts +val isCiServer = System.getenv().containsKey("CI") +// Cache build artifacts, so expensive operations do not need to be re-computed +buildCache { + local { + isEnabled = !isCiServer + } +} \ No newline at end of file From b612d1c7aa0f654cc8548e866fcdf036d24a2954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Tue, 5 Dec 2023 19:52:50 -0700 Subject: [PATCH 4/6] fix name --- .github/workflows/gradle-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml index 73e2253ed..0e7edd345 100644 --- a/.github/workflows/gradle-build.yml +++ b/.github/workflows/gradle-build.yml @@ -28,7 +28,7 @@ jobs: settings-path: ${{ github.workspace }} # location for the settings.xml file - uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6 - name: Build PROJECT_NAME + name: Build Terra with: # Specifies arguments for Gradle execution # If arguments is missing or empty, then Gradle is not executed From cb9aa4f167d3f75e6df1b7ada45da7839cb84d31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Tue, 5 Dec 2023 19:53:05 -0700 Subject: [PATCH 5/6] fix permissions --- .github/workflows/gradle-build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml index 0e7edd345..0a8804cbb 100644 --- a/.github/workflows/gradle-build.yml +++ b/.github/workflows/gradle-build.yml @@ -15,7 +15,6 @@ jobs: runs-on: ubuntu-latest permissions: contents: read - packages: write steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 From e160cae3d80a1e57a63b274be14d4213f88e88e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Tue, 5 Dec 2023 20:04:08 -0700 Subject: [PATCH 6/6] reformat --- .github/workflows/gradle-build.yml | 56 +++++++++++++++--------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml index 0a8804cbb..3e40fe7be 100644 --- a/.github/workflows/gradle-build.yml +++ b/.github/workflows/gradle-build.yml @@ -7,7 +7,7 @@ name: Gradle Build -on: [pull_request] +on: [ pull_request ] jobs: build: @@ -17,31 +17,31 @@ jobs: contents: read steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - name: Set up JDK 17 - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 - with: - java-version: '17' - distribution: 'temurin' - server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - settings-path: ${{ github.workspace }} # location for the settings.xml file + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - name: Set up JDK 17 + uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 + with: + java-version: '17' + distribution: 'temurin' + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file - - uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6 - name: Build Terra - with: - # Specifies arguments for Gradle execution - # If arguments is missing or empty, then Gradle is not executed - arguments: build - # arguments can be multi-line for better readability - # arguments: | - # --no-paralell - # build - # -x test - # Gradle version to use for execution: - # wrapper (default), current, rc, nightly, release-nightly, or - # versions like 6.6 (see https://services.gradle.org/versions/all) - gradle-version: wrapper - # Properties are passed as -Pname=value - properties: | - kotlin.js.compiler=ir - kotlin.parallel.tasks.in.project=true \ No newline at end of file + - uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6 + name: Build Terra + with: + # Specifies arguments for Gradle execution + # If arguments is missing or empty, then Gradle is not executed + arguments: build + # arguments can be multi-line for better readability + # arguments: | + # --no-paralell + # build + # -x test + # Gradle version to use for execution: + # wrapper (default), current, rc, nightly, release-nightly, or + # versions like 6.6 (see https://services.gradle.org/versions/all) + gradle-version: wrapper + # Properties are passed as -Pname=value + properties: | + kotlin.js.compiler=ir + kotlin.parallel.tasks.in.project=true \ No newline at end of file