Skip to content

Commit

Permalink
Merge pull request #118 from Lombiq/issue/MENT-157
Browse files Browse the repository at this point in the history
MENT-157: build-and-test-orchard-core workflow shouldn't fail if there aren't any tests
  • Loading branch information
BenedekFarkas authored Dec 10, 2022
2 parents 31b0867 + 1cc58b4 commit cc7a626
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/actions/test-dotnet/Invoke-SolutionTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ $tests = dotnet sln list |
-not [string]::IsNullOrEmpty($result) -and $result.Contains("The following Tests are available")
}

Set-GitHubOutput "test-count" $tests.Length

Write-Output "Starting to execute tests from $($tests.Length) projects."

foreach ($test in $tests) {
Expand Down
7 changes: 4 additions & 3 deletions .github/actions/test-dotnet/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ runs:
"Lombiq_Tests_UI__OrchardCoreUITestExecutorConfiguration__MaxParallelTests=${{ inputs.ui-test-parallelism }}" >> $Env:GITHUB_ENV
- name: Run Tests
id: run-tests
shell: pwsh
working-directory: ${{ inputs.build-directory }}
run: |
Expand All @@ -80,13 +81,13 @@ runs:
# The same is true for the next step as well.
- name: Merge FailureDumps
shell: pwsh
if: success() || failure()
if: (success() || failure()) && steps.run-tests.outputs.test-count != 0
run: Merge-FailureDumps -Directory "${{ inputs.build-directory }}"

- name: Upload UI testing artifacts
uses: actions/[email protected]
# We don't need additional conditions, because of the "if-no-files-found" setting.
if: success() || failure()
if: (success() || failure()) && steps.run-tests.outputs.test-count != 0
with:
name: ui-test-failure-dump-${{ steps.setup.outputs.artifact-name-suffix }}
path: ${{ inputs.build-directory }}/FailureDumps/
Expand All @@ -95,7 +96,7 @@ runs:
- name: Test Report
# v10
uses: phoenix-actions/test-reporting@93ce19fa5882ebe3969ebdb9ee1024b3d29e776f
if: success() || failure()
if: (success() || failure()) && steps.run-tests.outputs.test-count != 0
with:
name: Test Results (${{inputs.build-directory}}|${{ steps.setup.outputs.runner-suffix }}
path: '${{inputs.build-directory}}/**/*.trx'
Expand Down

0 comments on commit cc7a626

Please sign in to comment.