From f3d3122f1ad4102d01bb6699a210f08457380e29 Mon Sep 17 00:00:00 2001 From: Vitalii Mikhailov Date: Wed, 14 Feb 2024 21:08:15 +0200 Subject: [PATCH 1/2] Tests: Retry for MacOS (#579) * Tests: Retry for MacOS * Update action.yml * Update action.yml * Increased timeouts --- .github/actions/test-execute-test/action.yml | 18 ++++++++++++++++-- .github/workflows/test-build.yml | 2 +- .github/workflows/test-qemu-dotnet.yml | 2 +- .github/workflows/test-qemu-mono.yml | 2 +- .github/workflows/test-unix-dotnet.yml | 2 +- .github/workflows/test-unix-mono.yml | 2 +- .github/workflows/test-windows-dotnet.yml | 2 +- .github/workflows/test-windows-framework.yml | 2 +- .github/workflows/test-windows-mono.yml | 2 +- 9 files changed, 24 insertions(+), 10 deletions(-) diff --git a/.github/actions/test-execute-test/action.yml b/.github/actions/test-execute-test/action.yml index e8e49044..054374e2 100644 --- a/.github/actions/test-execute-test/action.yml +++ b/.github/actions/test-execute-test/action.yml @@ -82,14 +82,28 @@ runs: } shell: pwsh - - name: Perform Tests Windows .NET | Ubuntu/MacOS/MacOS-arm64 .NET/Mono - if: ${{(inputs.os == 'windows' && inputs.runtime-type == 'dotnet') || inputs.os == 'ubuntu' || inputs.os == 'macos' || inputs.os == 'macos-arm64'}} + - name: Perform Tests Windows .NET | Ubuntu .NET/Mono + if: ${{(inputs.os == 'windows' && inputs.runtime-type == 'dotnet') || inputs.os == 'ubuntu'}} run: | foreach ($target_framework in ConvertFrom-Json "${{steps.test-args.outputs.target_frameworks}}") { dotnet test "HarmonyTests/bin/Release/$target_framework/HarmonyTests.dll" -f $target_framework ${{steps.test-args.outputs.dotnet}} -- ${{steps.test-args.outputs.run_settings_args}}; } shell: pwsh + # Not sure if continue_on_error: true is needed + - name: Perform Tests MacOS/MacOS-arm64 .NET/Mono + uses: nick-fields/retry@v3 + if: ${{inputs.os == 'macos' || inputs.os == 'macos-arm64'}} + with: + timeout_minutes: 3 + max_attempts: 3 + retry_on: timeout + command: | + foreach ($target_framework in ConvertFrom-Json "${{steps.test-args.outputs.target_frameworks}}") { + dotnet test "HarmonyTests/bin/Release/$target_framework/HarmonyTests.dll" -f $target_framework ${{steps.test-args.outputs.dotnet}} -- ${{steps.test-args.outputs.run_settings_args}}; + } + shell: pwsh + - name: Upload Test Result uses: ./.github/actions/test-upload-result if: ${{(inputs.upload_tests == 'true') && (always() || failure())}} diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 0542a471..a29e63af 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -40,7 +40,7 @@ jobs: name: Upload Test Build Output Cache runs-on: ${{inputs.image}} if: ${{!inputs.manual_build || inputs.publish}} - timeout-minutes: 8 + timeout-minutes: 10 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test-qemu-dotnet.yml b/.github/workflows/test-qemu-dotnet.yml index 023f0890..9d24c88e 100644 --- a/.github/workflows/test-qemu-dotnet.yml +++ b/.github/workflows/test-qemu-dotnet.yml @@ -39,7 +39,7 @@ jobs: name: .NET ubuntu-arm64 ${{ inputs.target_framework }} ${{ inputs.build_configuration }} runs-on: ubuntu-latest continue-on-error: ${{inputs.experimental}} - timeout-minutes: 8 + timeout-minutes: 10 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test-qemu-mono.yml b/.github/workflows/test-qemu-mono.yml index 83c5e51f..8fb9c82b 100644 --- a/.github/workflows/test-qemu-mono.yml +++ b/.github/workflows/test-qemu-mono.yml @@ -39,7 +39,7 @@ jobs: name: Mono ubuntu-arm64 ${{ inputs.target_framework }} ${{ inputs.build_configuration }} runs-on: ubuntu-latest continue-on-error: ${{inputs.experimental}} - timeout-minutes: 8 + timeout-minutes: 10 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test-unix-dotnet.yml b/.github/workflows/test-unix-dotnet.yml index d98adce3..3e656d10 100644 --- a/.github/workflows/test-unix-dotnet.yml +++ b/.github/workflows/test-unix-dotnet.yml @@ -56,7 +56,7 @@ jobs: name: .NET ${{inputs.os}}-${{inputs.architecture}} ${{ inputs.target_framework }} ${{inputs.build_configuration}} runs-on: ${{inputs.image}} continue-on-error: ${{inputs.experimental}} - timeout-minutes: 8 + timeout-minutes: 10 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test-unix-mono.yml b/.github/workflows/test-unix-mono.yml index 701321ec..48d5baf9 100644 --- a/.github/workflows/test-unix-mono.yml +++ b/.github/workflows/test-unix-mono.yml @@ -56,7 +56,7 @@ jobs: name: Mono ${{ inputs.os }}-${{ inputs.architecture }} ${{ inputs.target_framework }} ${{ inputs.build_configuration }} runs-on: ${{inputs.image}} continue-on-error: ${{inputs.experimental}} - timeout-minutes: 8 + timeout-minutes: 10 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test-windows-dotnet.yml b/.github/workflows/test-windows-dotnet.yml index 87c43af8..68967299 100644 --- a/.github/workflows/test-windows-dotnet.yml +++ b/.github/workflows/test-windows-dotnet.yml @@ -48,7 +48,7 @@ jobs: name: .NET ${{ inputs.architecture }} ${{ inputs.target_framework }} ${{ inputs.build_configuration }} runs-on: windows-latest continue-on-error: ${{inputs.experimental}} - timeout-minutes: 8 + timeout-minutes: 10 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test-windows-framework.yml b/.github/workflows/test-windows-framework.yml index 52fbbab2..28e9b77a 100644 --- a/.github/workflows/test-windows-framework.yml +++ b/.github/workflows/test-windows-framework.yml @@ -48,7 +48,7 @@ jobs: name: .NET FX ${{ inputs.architecture }} ${{ inputs.target_framework }} ${{ inputs.build_configuration }} runs-on: windows-2019 continue-on-error: ${{inputs.experimental}} - timeout-minutes: 8 + timeout-minutes: 10 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test-windows-mono.yml b/.github/workflows/test-windows-mono.yml index 0e6a247d..6b827925 100644 --- a/.github/workflows/test-windows-mono.yml +++ b/.github/workflows/test-windows-mono.yml @@ -48,7 +48,7 @@ jobs: name: Mono ${{ inputs.architecture }} ${{ inputs.target_framework }} ${{ inputs.build_configuration }} runs-on: windows-latest continue-on-error: ${{inputs.experimental}} - timeout-minutes: 8 + timeout-minutes: 10 steps: - uses: actions/checkout@v4 From 32e3f7b66d20adc9c5b3ea6607ddc110e721598d Mon Sep 17 00:00:00 2001 From: Vitalii Mikhailov Date: Wed, 14 Feb 2024 21:08:34 +0200 Subject: [PATCH 2/2] Better mono setup on Windows (#578) --- .../test-setup-mono-windows/action.yml | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/.github/actions/test-setup-mono-windows/action.yml b/.github/actions/test-setup-mono-windows/action.yml index 21df55e3..f7f84aeb 100644 --- a/.github/actions/test-setup-mono-windows/action.yml +++ b/.github/actions/test-setup-mono-windows/action.yml @@ -14,28 +14,8 @@ outputs: runs: using: "composite" steps: - - name: Setup Mono x86 Manually - if: inputs.architecture == 'x86' - run: | - curl -L https://download.mono-project.com/archive/mono-latest-x86-preview.msi -o mono.msi; - $file = "mono.msi" - $log = "install.log" - $procMain = Start-Process "msiexec" "/i `"$file`" /qn /l*! `"$log`"" -NoNewWindow -PassThru - $procLog = Start-Process "powershell" "Get-Content -Path `"$log`" -Wait" -NoNewWindow -PassThru - $procMain.WaitForExit() - $procLog.Kill() - shell: pwsh - - - name: Setup Mono x64 Manually - if: inputs.architecture == 'x64' - run: | - curl -L https://download.mono-project.com/archive/mono-latest-x64-preview.msi -o mono.msi; - $file = "mono.msi" - $log = "install.log" - $procMain = Start-Process "msiexec" "/i `"$file`" /qn /l*! `"$log`"" -NoNewWindow -PassThru - $procLog = Start-Process "powershell" "Get-Content -Path `"$log`" -Wait" -NoNewWindow -PassThru - $procMain.WaitForExit() - $procLog.Kill() + - name: Setup Mono + run: choco install mono --yes --no-progress --${{inputs.architecture}} --ignore-checksums shell: pwsh - name: Get Program Files path for ${{inputs.architecture}}