forked from loafle/openapi-generator-original
[ci] Update gitattributes and allow skipping docs generation for Windows CI workflows (#7273)
This commit is contained in:
parent
da84d8e3bf
commit
0e9c6dd9a8
29
.gitattributes
vendored
29
.gitattributes
vendored
@ -1 +1,28 @@
|
|||||||
**/*.mustache linguist-vendored=true
|
* text=auto
|
||||||
|
|
||||||
|
## Windows Specific stuff
|
||||||
|
*.vcproj text eol=crlf
|
||||||
|
*.bat text eol=crlf
|
||||||
|
*.cmd text eol=crlf
|
||||||
|
|
||||||
|
*.txt text eol=lf
|
||||||
|
*.yaml text eol=lf
|
||||||
|
*.yml text eol=lf
|
||||||
|
*.json text eol=lf
|
||||||
|
*.md text eol=lf
|
||||||
|
*.xml text eol=lf
|
||||||
|
gradlew text eol=lf
|
||||||
|
*.sh text eol=lf
|
||||||
|
*.properties text eol=lf
|
||||||
|
*.java text eol=lf
|
||||||
|
.gitignore text eol=lf
|
||||||
|
.gradle text eol=lf
|
||||||
|
.sbt text eol=lf
|
||||||
|
.scala text eol=lf
|
||||||
|
.ts text eol=lf
|
||||||
|
.adoc text eol=lf
|
||||||
|
.svg text eol=lf
|
||||||
|
|
||||||
|
*.mustache text eol=lf linguist-vendored=true
|
||||||
|
*.hbs text eol=lf linguist-vendored=true
|
||||||
|
*.handlebars text eol=lf linguist-vendored=true
|
||||||
|
@ -65,7 +65,10 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest]
|
os: [ubuntu-latest]
|
||||||
|
include:
|
||||||
|
- os: windows-latest
|
||||||
|
flags: --skip-docs
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
@ -79,4 +82,4 @@ jobs:
|
|||||||
git config core.fileMode false
|
git config core.fileMode false
|
||||||
mkdir -p modules/openapi-generator-cli/target/
|
mkdir -p modules/openapi-generator-cli/target/
|
||||||
mv artifact/openapi-generator-cli.jar modules/openapi-generator-cli/target/
|
mv artifact/openapi-generator-cli.jar modules/openapi-generator-cli/target/
|
||||||
./bin/utils/ensure-up-to-date
|
./bin/utils/ensure-up-to-date ${{ matrix.flags }}
|
||||||
|
@ -19,6 +19,13 @@ if [ $status -ne 0 ]; then
|
|||||||
exit $status
|
exit $status
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "--skip-docs" == "${1}" ]]; then
|
||||||
|
# We export here rather than modify our iterable so that:
|
||||||
|
# - the scripts can show they ran and echo meaningfully
|
||||||
|
# - the scripts can do cleanup (if necessary) when skipped
|
||||||
|
export SKIP_EXPORT_DOCS=true
|
||||||
|
fi
|
||||||
|
|
||||||
# Some special case generators may expect to be run as a stanalone process (e.g. modifying classpath)
|
# Some special case generators may expect to be run as a stanalone process (e.g. modifying classpath)
|
||||||
# Docs should always be run, regardless of batch or operation.
|
# Docs should always be run, regardless of batch or operation.
|
||||||
declare -a always_iterate=(
|
declare -a always_iterate=(
|
||||||
|
@ -5,6 +5,11 @@ echo "# START SCRIPT: ${SCRIPT}"
|
|||||||
|
|
||||||
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||||
|
|
||||||
|
if [[ "true" == "${SKIP_EXPORT_DOCS}" ]]; then
|
||||||
|
echo "Skipping doc exports. Note that docs generated by Windows may break paths as they have not yet been normalized to OS-specific paths."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
for GENERATOR in $(java -jar ${executable} list --short --include all | sed -e 's/,/\'$'\n''/g')
|
for GENERATOR in $(java -jar ${executable} list --short --include all | sed -e 's/,/\'$'\n''/g')
|
||||||
do
|
do
|
||||||
./bin/utils/export_generator.sh ${GENERATOR}
|
./bin/utils/export_generator.sh ${GENERATOR}
|
||||||
|
@ -110,9 +110,6 @@ hs_err_pid*
|
|||||||
.AppleDouble
|
.AppleDouble
|
||||||
.LSOverride
|
.LSOverride
|
||||||
|
|
||||||
# Icon must end with two \r
|
|
||||||
Icon
|
|
||||||
|
|
||||||
# Thumbnails
|
# Thumbnails
|
||||||
._*
|
._*
|
||||||
|
|
||||||
|
@ -1352,7 +1352,9 @@ public class DefaultGenerator implements Generator {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
String relativeMeta = METADATA_DIR + File.separator + "VERSION";
|
// NOTE: Don't use File.separator here as we write linux-style paths to FILES, and File.separator will
|
||||||
|
// result in incorrect match on Windows machines.
|
||||||
|
String relativeMeta = METADATA_DIR + "/VERSION";
|
||||||
filesToSort.sort(PathFileComparator.PATH_COMPARATOR);
|
filesToSort.sort(PathFileComparator.PATH_COMPARATOR);
|
||||||
filesToSort.forEach(f -> {
|
filesToSort.forEach(f -> {
|
||||||
String tmp = outDir.toPath().relativize(f.toPath()).normalize().toString();
|
String tmp = outDir.toPath().relativize(f.toPath()).normalize().toString();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user