-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
49 additions
and
26 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 |
---|---|---|
@@ -1,41 +1,24 @@ | ||
name: Build and Test | ||
|
||
on: | ||
pull_request: | ||
pull_request: | ||
|
||
env: | ||
TEST_RESULTS_PATH: ${{ github.workspace }}/test-results.trx | ||
|
||
permissions: | ||
contents: read | ||
actions: read | ||
checks: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4.1.7 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4.0.0 | ||
- uses: actions/checkout@v4.1.7 | ||
- uses: actions/setup-dotnet@v4.0.0 | ||
with: | ||
dotnet-version: 8.0.100 | ||
- name: Dotnet Build | ||
run: dotnet build --configuration Release | ||
- name: Dotnet Test | ||
run: | | ||
dotnet test --configuration Release --no-restore --no-build --logger "trx;LogFileName=${{ env.TEST_RESULTS_PATH }}" | ||
- name: Upload test results | ||
uses: actions/upload-artifact@v4 | ||
if: success() || failure() | ||
- run: dotnet build --configuration Release | ||
- run: | | ||
dotnet test --configuration Release --no-restore --no-build \ | ||
--logger "trx;LogFileName=${{ env.TEST_RESULTS_PATH }}" | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-results | ||
name: upload-test-results | ||
path: ${{ env.TEST_RESULTS_PATH }} | ||
- name: Upload test results | ||
uses: dorny/test-reporter@v1.9.1 | ||
if: success() || failure() | ||
with: | ||
name: XUnit Tests | ||
path: ${{ env.TEST_RESULTS_PATH }} | ||
reporter: dotnet-trx |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Publish Test | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4.1.7 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4.0.0 | ||
with: | ||
dotnet-version: 8.0.100 | ||
- name: Dotnet Publish | ||
run: dotnet publish |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Report Test | ||
|
||
on: | ||
workflow_run: | ||
workflows: ['Build and Test'] | ||
types: | ||
- completed | ||
|
||
permissions: | ||
contents: read | ||
actions: read | ||
checks: write | ||
|
||
jobs: | ||
report: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: dorny/test-reporter@v1 | ||
with: | ||
artifact: upload-test-results | ||
name: XUnit Tests | ||
path: "*.trx" | ||
reporter: dotnet-trx |