From 0d150cdbb8b0a4bb7a0a1dd58d4dc51fcb8f5a6d Mon Sep 17 00:00:00 2001 From: micronaut-build <65172877+micronaut-build@users.noreply.github.com> Date: Wed, 3 Aug 2022 16:31:38 -0400 Subject: [PATCH] ci: Gradle 7.5 GraalVM Matrix, Java 11 (#234) --- .editorconfig | 23 ++++ .gitattributes | 21 +++ .github/workflows/central-sync.yml | 2 +- .github/workflows/graalvm.yml | 3 +- .github/workflows/gradle.yml | 10 +- .github/workflows/publish-snapshot.yml | 2 +- .github/workflows/release.yml | 2 +- gradlew.bat | 182 ++++++++++++------------- 8 files changed, 148 insertions(+), 97 deletions(-) create mode 100644 .editorconfig create mode 100644 .gitattributes diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..a9a165ba --- /dev/null +++ b/.editorconfig @@ -0,0 +1,23 @@ +root = true + +[*] +trim_trailing_whitespace = true +insert_final_newline = true +charset = utf-8 +indent_style = space + +[{*.sh,gradlew}] +end_of_line = lf + +[{*.bat,*.cmd}] +end_of_line = crlf + +[*.java] +indent_size = 4 +tab_width = 4 +max_line_length = 100 +# Import order can be configured with ij_java_imports_layout=... +# See documentation https://youtrack.jetbrains.com/issue/IDEA-170643#focus=streamItem-27-3708697.0-0 + +[*.xml] +indent_size = 4 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..31628339 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,21 @@ +# Auto detect text files and perform LF normalization +* text=auto + +*.java text +*.html text +*.kt text +*.kts text +*.md text diff=markdown +*.py text diff=python executable +*.pl text diff=perl executable +*.pm text diff=perl +*.css text diff=css +*.js text +*.sql text +*.q text + +*.sh text eol=lf +gradlew text eol=lf + +*.bat text eol=crlf +*.cmd text eol=crlf diff --git a/.github/workflows/central-sync.yml b/.github/workflows/central-sync.yml index 3a337d59..3d550abb 100644 --- a/.github/workflows/central-sync.yml +++ b/.github/workflows/central-sync.yml @@ -23,7 +23,7 @@ jobs: uses: actions/setup-java@v3 with: distribution: 'adopt' - java-version: '8' + java-version: '11' - name: Publish to Sonatype OSSRH env: SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} diff --git a/.github/workflows/graalvm.yml b/.github/workflows/graalvm.yml index ad242cb6..2fa66fa3 100644 --- a/.github/workflows/graalvm.yml +++ b/.github/workflows/graalvm.yml @@ -20,6 +20,7 @@ jobs: strategy: matrix: java: ['11', '17'] + graalvm: ['latest', 'dev'] steps: # https://github.com/actions/virtual-environments/issues/709 - name: Free disk space @@ -38,7 +39,7 @@ jobs: - name: Setup GraalVM CE uses: graalvm/setup-graalvm@v1 with: - version: '22.1.0' + version: ${{ matrix.graalvm }} java-version: ${{ matrix.java }} components: 'native-image' - name: Build with Gradle diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index cf543e1e..e1e63f97 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -65,8 +65,14 @@ jobs: check_name: Java CI / Test Report (${{ matrix.java }}) report_paths: '**/build/test-results/test/TEST-*.xml' check_retries: 'true' + - name: "📜 Upload binary compatibility check results" + if: always() + uses: actions/upload-artifact@v2 + with: + name: binary-compatibility-reports + path: "**/build/reports/binary-compatibility-*.html" - name: Publish to Sonatype Snapshots - if: success() && github.event_name == 'push' && matrix.java == '8' + if: success() && github.event_name == 'push' && matrix.java == '11' env: SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} @@ -82,7 +88,7 @@ jobs: if_true: "micronaut-projects/micronaut-docs" if_false: ${{ github.repository }} - name: Publish to Github Pages - if: success() && github.event_name == 'push' && matrix.java == '8' + if: success() && github.event_name == 'push' && matrix.java == '11' uses: micronaut-projects/github-pages-deploy-action@master env: TARGET_REPOSITORY: ${{ steps.docs_target.outputs.value }} diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml index a121b39d..8b70c7e4 100644 --- a/.github/workflows/publish-snapshot.yml +++ b/.github/workflows/publish-snapshot.yml @@ -21,7 +21,7 @@ jobs: uses: actions/setup-java@v3 with: distribution: 'adopt' - java-version: '8' + java-version: '11' - name: Publish to Sonatype Snapshots if: success() env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f5f64a5..13dcbbca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: uses: actions/setup-java@v3 with: distribution: 'adopt' - java-version: '8' + java-version: '11' - name: Set the current release version id: release_version run: echo ::set-output name=release_version::${GITHUB_REF:11} diff --git a/gradlew.bat b/gradlew.bat index 53a6b238..f127cfd4 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,91 +1,91 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega