diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6bfec77 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,68 @@ +* text=auto eol=lf + +################################################################################ +# The following files are binary and should be left untouched. +# Git should not attempt to normalize line endings or generate text diffs. +################################################################################ + +# Archives +*.zip binary +*.gz binary +*.tar binary +*.rar binary +*.7z binary +*.vsix binary + +# Compiled Code / Packages +*.jar binary +*.war binary +*.ear binary +*.class binary +*.dll binary +*.exe binary +*.so binary +*.a binary +*.node binary +*.wasm binary + +# Documents +*.pdf binary +*.doc binary +*.docx binary +*.xls binary +*.xlsx binary +*.ppt binary +*.pptx binary +*.odt binary + +# Images +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.bmp binary +*.ico binary +*.tif binary +*.tiff binary +*.webp binary + +# Audio & Video +*.mp3 binary +*.mp4 binary +*.mkv binary +*.wav binary +*.ogg binary +*.mov binary + +# Other +*.keystore binary +*.jks binary +*.db binary +*.sqlite binary + +# Windows batch files must always use CRLF, or they may fail to execute. +*.bat text eol=crlf +*.cmd text eol=crlf + +# PowerShell can handle LF, but CRLF is safer for Windows-specific scripts +*.ps1 text eol=crlf diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index be8d215..f0f1ad3 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -95,7 +95,14 @@ jobs: test: needs: [ format, lint, audit, get-configs ] - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash env: WORKING_DIR: ${{ needs.get-configs.outputs.working-dir }} steps: @@ -128,7 +135,14 @@ jobs: test-jvm: needs: [ format, lint, audit, get-configs ] - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash env: WORKING_DIR: ${{ needs.get-configs.outputs.working-dir }} steps: @@ -166,7 +180,14 @@ jobs: test-wasm: needs: [ format, lint, audit, get-configs ] - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash env: WORKING_DIR: ${{ needs.get-configs.outputs.working-dir }} steps: diff --git a/gradlew.bat b/gradlew.bat index 5eed7ee..db3a6ac 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,94 +1,94 @@ -@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 -@rem SPDX-License-Identifier: Apache-2.0 -@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=. -@rem This is normally unused -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. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH= - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* - -: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 +@rem SPDX-License-Identifier: Apache-2.0 +@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=. +@rem This is normally unused +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. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH= + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* + +: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 diff --git a/src/bindings-jvm/tests/kotlin/src/test/kotlin/SmokeTest.kt b/src/bindings-jvm/tests/kotlin/src/test/kotlin/SmokeTest.kt index c4db510..80ddb93 100644 --- a/src/bindings-jvm/tests/kotlin/src/test/kotlin/SmokeTest.kt +++ b/src/bindings-jvm/tests/kotlin/src/test/kotlin/SmokeTest.kt @@ -40,7 +40,7 @@ class SmokeTest { val dir = File(templatesRoot, sub) if (dir.isDirectory) { dir.walkTopDown().filter { it.isFile && it.extension in listOf("yaml", "yml", "json") }.forEach { - templates.add(it.relativeTo(templatesRoot).path) + templates.add(it.relativeTo(templatesRoot).path.replace('\\', '/')) } } } diff --git a/src/bindings-wasm/tests/smoke.test.ts b/src/bindings-wasm/tests/smoke.test.ts index 91fed42..d28b95b 100644 --- a/src/bindings-wasm/tests/smoke.test.ts +++ b/src/bindings-wasm/tests/smoke.test.ts @@ -36,7 +36,7 @@ function discoverAllTemplates(): string[] { const full = path.join(dir, entry.name); if (entry.isDirectory()) walk(full); else if (/\.(yaml|yml|json)$/.test(entry.name)) { - templates.push(path.relative(TEMPLATES_ROOT, full)); + templates.push(path.relative(TEMPLATES_ROOT, full).replace(/\\/g, '/')); } } } diff --git a/src/cfn-validate/tests/common/mod.rs b/src/cfn-validate/tests/common/mod.rs index 54322be..75e2ec2 100644 --- a/src/cfn-validate/tests/common/mod.rs +++ b/src/cfn-validate/tests/common/mod.rs @@ -67,7 +67,7 @@ fn walk_collect(dir: &std::path::Path, root: &std::path::Path, out: &mut Vec