-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use retry action for failed tests (#349)
Use [retry action](https://github.com/marketplace/actions/retry-action) to retry a failed test step once in the build pipeline. Co-authored-by: Valentin Breuß <[email protected]>
- Loading branch information
Showing
3 changed files
with
50 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,7 +77,10 @@ jobs: | |
- name: Build solution | ||
run: dotnet build /p:NetCoreOnly=True --configuration "Release" | ||
- name: Run tests | ||
run: dotnet test --no-build --collect:"XPlat Code Coverage" | ||
uses: Wandalen/[email protected] | ||
with: | ||
command: dotnet test --no-build --collect:"XPlat Code Coverage" | ||
attempt_limit: 2 | ||
- name: Upload coverage | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
|
@@ -101,7 +104,10 @@ jobs: | |
- name: Build solution | ||
run: dotnet build /p:NetCoreOnly=True --configuration "Release" | ||
- name: Run tests | ||
run: dotnet test --no-build --collect:"XPlat Code Coverage" | ||
uses: Wandalen/[email protected] | ||
with: | ||
command: dotnet test --no-build --collect:"XPlat Code Coverage" | ||
attempt_limit: 2 | ||
- name: Upload coverage | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
|
@@ -125,7 +131,10 @@ jobs: | |
- name: Build solution | ||
run: dotnet build /p:NetCoreOnly=True --configuration "Release" | ||
- name: Run tests | ||
run: dotnet test --no-build --collect:"XPlat Code Coverage" | ||
uses: Wandalen/[email protected] | ||
with: | ||
command: dotnet test --no-build --collect:"XPlat Code Coverage" | ||
attempt_limit: 2 | ||
- name: Upload coverage | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
|
@@ -176,7 +185,10 @@ jobs: | |
- name: Build example solution | ||
run: dotnet build Examples /p:UseFileReferenceToTestablyLibraries=True | ||
- name: Run example tests | ||
run: dotnet test Examples --no-build | ||
uses: Wandalen/[email protected] | ||
with: | ||
command: dotnet test Examples --no-build | ||
attempt_limit: 2 | ||
|
||
upload-coverage: | ||
name: Upload coverage to Codacy | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,10 @@ jobs: | |
- name: Build solution | ||
run: dotnet build /p:NetCoreOnly=True --configuration "Release" | ||
- name: Run tests | ||
run: dotnet test --no-build --collect:"XPlat Code Coverage" --logger trx --results-directory "TestResults" | ||
uses: Wandalen/[email protected] | ||
with: | ||
command: dotnet test --no-build --collect:"XPlat Code Coverage" --logger trx --results-directory "TestResults" | ||
attempt_limit: 2 | ||
- name: Upload test results (MacOS) | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v3 | ||
|
@@ -53,7 +56,10 @@ jobs: | |
- name: Build solution | ||
run: dotnet build /p:NetCoreOnly=True --configuration "Release" | ||
- name: Run tests | ||
run: dotnet test --no-build --collect:"XPlat Code Coverage" --logger trx --results-directory "TestResults" | ||
uses: Wandalen/[email protected] | ||
with: | ||
command: dotnet test --no-build --collect:"XPlat Code Coverage" --logger trx --results-directory "TestResults" | ||
attempt_limit: 2 | ||
- name: Upload test results (Ubuntu) | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v3 | ||
|
@@ -83,7 +89,10 @@ jobs: | |
- name: Build solution | ||
run: dotnet build /p:NetCoreOnly=True --configuration "Release" | ||
- name: Run tests | ||
run: dotnet test --no-build --collect:"XPlat Code Coverage" --logger trx --results-directory "TestResults" | ||
uses: Wandalen/[email protected] | ||
with: | ||
command: dotnet test --no-build --collect:"XPlat Code Coverage" --logger trx --results-directory "TestResults" | ||
attempt_limit: 2 | ||
- name: Upload test results (Windows) | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v3 | ||
|
@@ -130,8 +139,10 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
- name: Save PR number to file | ||
if: github.event_name == 'pull_request' | ||
run: echo ${{ github.event.number }} > PR_NUMBER.txt | ||
- name: Archive PR number | ||
if: github.event_name == 'pull_request' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: PR_NUMBER | ||
|
@@ -147,4 +158,7 @@ jobs: | |
- name: Build example solution | ||
run: dotnet build Examples /p:UseFileReferenceToTestablyLibraries=True | ||
- name: Run example tests | ||
run: dotnet test Examples --no-build | ||
uses: Wandalen/[email protected] | ||
with: | ||
command: dotnet test Examples --no-build | ||
attempt_limit: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,7 +88,10 @@ jobs: | |
- name: Build solution | ||
run: dotnet build /p:NetCoreOnly=True --configuration "Release" | ||
- name: Run tests | ||
run: dotnet test --no-build | ||
uses: Wandalen/[email protected] | ||
with: | ||
command: dotnet test --no-build | ||
attempt_limit: 2 | ||
|
||
test-ubuntu: | ||
name: Test (Ubuntu) | ||
|
@@ -112,7 +115,10 @@ jobs: | |
- name: Build solution | ||
run: dotnet build /p:NetCoreOnly=True --configuration "Release" | ||
- name: Run tests | ||
run: dotnet test --no-build | ||
uses: Wandalen/[email protected] | ||
with: | ||
command: dotnet test --no-build | ||
attempt_limit: 2 | ||
|
||
test-windows: | ||
name: Test (Windows) | ||
|
@@ -136,7 +142,10 @@ jobs: | |
- name: Build solution | ||
run: dotnet build /p:NetCoreOnly=True --configuration "Release" | ||
- name: Run tests | ||
run: dotnet test --no-build | ||
uses: Wandalen/[email protected] | ||
with: | ||
command: dotnet test --no-build | ||
attempt_limit: 2 | ||
|
||
test-net-framework: | ||
name: Test (.NET Framework) | ||
|
@@ -186,7 +195,10 @@ jobs: | |
- name: Build example solution | ||
run: dotnet build Examples /p:UseFileReferenceToTestablyLibraries=True --configuration "Release" | ||
- name: Run example tests | ||
run: dotnet test Examples --no-build | ||
uses: Wandalen/[email protected] | ||
with: | ||
command: dotnet test Examples --no-build | ||
attempt_limit: 2 | ||
|
||
stryker-ubuntu: | ||
name: Analyze quality of unit test coverage with .NET Stryker (Ubuntu) | ||
|