From 172c4fb23d8337bb691640862b3f2f98dfa7af12 Mon Sep 17 00:00:00 2001 From: Gerd Aschemann Date: Sat, 17 Aug 2024 09:33:15 +0200 Subject: [PATCH] #318 Separate Failure handling on Windows and Unixes --- .github/workflows/build-artifacts.yml | 17 +++++++++++++++-- .github/workflows/test-java-os-mix.yml | 21 +++++++++++++++------ 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index b4847eef..cb60c8dd 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -75,8 +75,8 @@ jobs: path: | **/build - - name: Collect state upon failure - if: failure() + - name: Collect state upon failure (On Unix) + if: failure() && runner.os != 'Windows' run: | echo "Git:" git status @@ -86,3 +86,16 @@ jobs: pwd echo "Files:" find * -ls + + - name: Collect state upon failure (On Windows) + if: failure() && runner.os == 'Windows' + shell: pwsh + run: | + echo "Git:" + git status + echo "Env:" + env + echo "PWD:" + pwd + echo "Files:" + Get-ChildItem -Recurse -File | Format-Table Name, Length, LastWriteTime \ No newline at end of file diff --git a/.github/workflows/test-java-os-mix.yml b/.github/workflows/test-java-os-mix.yml index 5a453710..3f438746 100644 --- a/.github/workflows/test-java-os-mix.yml +++ b/.github/workflows/test-java-os-mix.yml @@ -57,12 +57,8 @@ jobs: cmd /c "echo off && gradlew.bat --version" cmd /c "echo off && gradlew.bat htmlSanityCheck --scan" - # If we ever need to debug the file system contents - # Get-ChildItem -Recurse -File | Format-Table Name, Length, LastWriteTime - # Get-ChildItem -Recurse -File ./integration-test | Format-Table Name, Length, LastWriteTime - - - name: Collect state upon failure - if: failure() + - name: Collect state upon failure (On Unix) + if: failure() && runner.os != 'Windows' run: | echo "Git:" git status @@ -72,3 +68,16 @@ jobs: pwd echo "Files:" find * -ls + + - name: Collect state upon failure (On Windows) + if: failure() && runner.os == 'Windows' + shell: pwsh + run: | + echo "Git:" + git status + echo "Env:" + env + echo "PWD:" + pwd + echo "Files:" + Get-ChildItem -Recurse -File | Format-Table Name, Length, LastWriteTime \ No newline at end of file