Skip to content

Commit

Permalink
Full test coverage using Github Workflows (#2483)
Browse files Browse the repository at this point in the history
* new builds for other solutions

* fix name

* remove ubuntu

* typo

* testing additional frameworks

* typo

* test, remove exclude

* full framework coverage

* cleanup

* cleanup

* typo
  • Loading branch information
TimothyMothra committed Dec 1, 2021
1 parent 4451e34 commit 26002b5
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 14 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/build-and-test-BASE.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Syntax: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
# .NET CLI: https://docs.microsoft.com/dotnet/core/tools/
# Description: The purpose of this build is to build and test on both Windows and Linux.
# Description: The purpose of this workflow is to compile and run unit tests.

name: Build And Test, BASE

Expand All @@ -16,14 +16,17 @@ jobs:

runs-on: ${{ matrix.os }}

env:
SOLUTION: ./BASE/Microsoft.ApplicationInsights.sln

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
framework: [netcoreapp3.1,net5.0,net6.0]
framework: [net452, net462, net472, net480, netcoreapp3.1, net5.0, net6.0]
include:
- os: ubuntu-latest
args: "--filter TestCategory!=WindowsOnly"
- os: ubuntu-latest
args: "--filter TestCategory!=WindowsOnly"

steps:
- uses: actions/checkout@v2
Expand All @@ -41,15 +44,15 @@ jobs:
dotnet-version: '6.0.x'

- name: Restore
run: dotnet restore ./BASE/Microsoft.ApplicationInsights.sln
run: dotnet restore ${{ env.SOLUTION }}

- name: Build
run: dotnet build ./BASE/Microsoft.ApplicationInsights.sln --configuration Release --no-restore
run: dotnet build ${{ env.SOLUTION }} --configuration Release --no-restore

- name: Test
id: test1
continue-on-error: true
run: dotnet test ./BASE/Microsoft.ApplicationInsights.sln --framework ${{ matrix.framework }} --configuration Release --no-build --logger:"console;verbosity=detailed" --logger:"trx;logfilename=${{ github.workspace }}/testResults.trx" ${{ matrix.args }}
run: dotnet test ${{ env.SOLUTION }} --framework ${{ matrix.framework }} --configuration Release --no-build --logger:"console;verbosity=detailed" --logger:"trx;logfilename=${{ github.workspace }}/testResults.trx" ${{ matrix.args }}

- name: Retry tests
if: steps.test1.outcome=='failure'
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/build-and-test-LOGGING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Syntax: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
# .NET CLI: https://docs.microsoft.com/dotnet/core/tools/
# Description: The purpose of this workflow is to compile and run unit tests.

name: Build And Test, LOGGING

on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build-test-LOGGING:

runs-on: ${{ matrix.os }}

env:
SOLUTION: ./LOGGING/Logging.sln

strategy:
fail-fast: false
matrix:
os: [windows-latest]
framework: [net452, net462, net472, net480, netcoreapp3.1, net5.0, net6.0]

steps:
- uses: actions/checkout@v2

- uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'

- uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'

- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'

- name: Restore
run: dotnet restore ${{ env.SOLUTION }}

- name: Build
run: dotnet build ${{ env.SOLUTION }} --configuration Release --no-restore

- name: Test
id: test1
continue-on-error: true
run: dotnet test ${{ env.SOLUTION }} --framework ${{ matrix.framework }} --configuration Release --no-build --logger:"console;verbosity=detailed" --logger:"trx;logfilename=${{ github.workspace }}/testResults.trx" ${{ matrix.args }}

- name: Retry tests
if: steps.test1.outcome=='failure'
run: pwsh -f ./.scripts/build_RetryTests.ps1 -TestResultFile ${{ github.workspace }}/testResults.trx -WorkingDirectory ${{ github.workspace }}

18 changes: 11 additions & 7 deletions .github/workflows/build-and-test-NETCORE.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Syntax: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
# .NET CLI: https://docs.microsoft.com/dotnet/core/tools/
# Description: The purpose of this build is to build and test on both Windows and Linux.
# Description: The purpose of this workflow is to compile and run unit tests.

name: Build And Test, NETCORE

on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
Expand All @@ -15,14 +16,17 @@ jobs:

runs-on: ${{ matrix.os }}

env:
SOLUTION: ./NETCORE/ApplicationInsights.AspNetCore.sln

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
framework: [netcoreapp3.1,net5.0,net6.0]
framework: [net452, net462, net472, net480, netcoreapp3.1, net5.0, net6.0]
include:
- os: ubuntu-latest
args: "--filter TestCategory!=WindowsOnly"
- os: ubuntu-latest
args: "--filter TestCategory!=WindowsOnly"

steps:
- uses: actions/checkout@v2
Expand All @@ -40,15 +44,15 @@ jobs:
dotnet-version: '6.0.x'

- name: Restore
run: dotnet restore ./NETCORE/ApplicationInsights.AspNetCore.sln
run: dotnet restore ${{ env.SOLUTION }}

- name: Build
run: dotnet build ./NETCORE/ApplicationInsights.AspNetCore.sln --configuration Release --no-restore
run: dotnet build ${{ env.SOLUTION }} --configuration Release --no-restore

- name: Test
id: test1
continue-on-error: true
run: dotnet test ./NETCORE/ApplicationInsights.AspNetCore.sln --framework ${{ matrix.framework }} --configuration Release --no-build --logger:"console;verbosity=detailed" --logger:"trx;logfilename=${{ github.workspace }}/testResults.trx" ${{ matrix.args }}
run: dotnet test ${{ env.SOLUTION }} --framework ${{ matrix.framework }} --configuration Release --no-build --logger:"console;verbosity=detailed" --logger:"trx;logfilename=${{ github.workspace }}/testResults.trx" ${{ matrix.args }}

- name: Retry tests
if: steps.test1.outcome=='failure'
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/build-and-test-WEB.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Syntax: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
# .NET CLI: https://docs.microsoft.com/dotnet/core/tools/
# Description: The purpose of this workflow is to compile and run unit tests.

name: Build And Test, WEB

on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build-test-WEB:

runs-on: ${{ matrix.os }}

env:
SOLUTION: ./WEB/Src/Microsoft.ApplicationInsights.Web.sln

strategy:
fail-fast: false
matrix:
os: [windows-latest]
framework: [net452, net462, net472, net480, netcoreapp3.1, net5.0, net6.0]

steps:
- uses: actions/checkout@v2

- uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'

- uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'

- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'

- name: Restore
run: dotnet restore ${{ env.SOLUTION }}

- name: Build
run: dotnet build ${{ env.SOLUTION }} --configuration Release --no-restore

- name: Test
id: test1
continue-on-error: true
run: dotnet test ${{ env.SOLUTION }} --framework ${{ matrix.framework }} --configuration Release --no-build --logger:"console;verbosity=detailed" --logger:"trx;logfilename=${{ github.workspace }}/testResults.trx" ${{ matrix.args }}

- name: Retry tests
if: steps.test1.outcome=='failure'
run: pwsh -f ./.scripts/build_RetryTests.ps1 -TestResultFile ${{ github.workspace }}/testResults.trx -WorkingDirectory ${{ github.workspace }}

0 comments on commit 26002b5

Please sign in to comment.