diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index a512fd2fab..e4eee511f2 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -47,6 +47,7 @@ jobs: os: [ ubuntu-latest, windows-latest, macos-latest ] steps: + - uses: actions/checkout@v2 - name: Setup environment variables run: | cat pom.xml | grep ".*" | head -1 | awk -F'[><]' '{ printf "DIKTAT_VERSION=%s\n",$3 }' >> $GITHUB_ENV @@ -67,7 +68,7 @@ jobs: continue-on-error: true if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }} run: | - ./ktlint -R diktat-${{ env.DIKTAT_VERSION }}.jar --disabled_rules=standard "examples/maven/src/main/kotlin/Test.kt" &> out + ./ktlint -R diktat-${{ env.DIKTAT_VERSION }}.jar --disabled_rules=standard "examples/maven/src/main/kotlin/Test.kt" &> out.txt shell: bash - name: Run diKTat from cli on windows @@ -80,9 +81,30 @@ jobs: - name: Check output id: cli-check run: | - if [ -f out.txt ]; then mv out.txt out; fi - cat out - grep -E "\[VARIABLE_NAME_INCORRECT_FORMAT\]" out + cat out.txt + grep -E "\[VARIABLE_NAME_INCORRECT_FORMAT\]" out.txt + rm out.txt + shell: bash + + - name: Run diKTat from cli (absolute paths) + continue-on-error: true + if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }} + run: | + ./ktlint -R diktat-${{ env.DIKTAT_VERSION }}.jar --disabled_rules=standard "$PWD/examples/maven/src/main/kotlin/Test.kt" &> out.txt + shell: bash + + - name: Run diKTat from cli on windows (absolute paths) + continue-on-error: true + if: runner.os == 'Windows' + run: | + java.exe -jar ktlint -R diktat-${{ env.DIKTAT_VERSION }}.jar --disabled_rules=standard "%cd%/examples/maven/src/main/kotlin/Test.kt" > out.txt 2>&1 + shell: cmd + + - name: Check output (absolute paths) + id: cli-check + run: | + cat out.txt + grep -E "\[VARIABLE_NAME_INCORRECT_FORMAT\]" out.txt shell: bash build_and_test: diff --git a/diktat-gradle-plugin/src/functionalTest/kotlin/org/cqfn/diktat/plugin/gradle/DiktatGradlePluginFunctionalTest.kt b/diktat-gradle-plugin/src/functionalTest/kotlin/org/cqfn/diktat/plugin/gradle/DiktatGradlePluginFunctionalTest.kt index e130a1ec8d..245bafec59 100644 --- a/diktat-gradle-plugin/src/functionalTest/kotlin/org/cqfn/diktat/plugin/gradle/DiktatGradlePluginFunctionalTest.kt +++ b/diktat-gradle-plugin/src/functionalTest/kotlin/org/cqfn/diktat/plugin/gradle/DiktatGradlePluginFunctionalTest.kt @@ -159,6 +159,7 @@ class DiktatGradlePluginFunctionalTest { } @Test + @DisabledOnOs(OS.WINDOWS, disabledReason = "Because of short directory notation") fun `should execute diktatCheck with absolute paths`() { val path = testProjectDir.root .resolve("src/**/*.kt")