11# This workflow is used test the project, by doing the following
22# 1. Ensure the project builds
3+ # 2. Run all tests
4+ # 3. Upload code coverage
35---
46name : Testing Matrix
57run-name : >-
68 ${{
79 format(
8- '{0}{1}{2} - Continuous Testing (Matrix) - ({3}-to-{4})',
9- github.event_name == 'pull_request' && 'PR#' || 'Push',
10- github.event.pull_request.draft && ' [DRAFT]' || '',
11- github.event_name == 'pull_request' && github.event.number || format(' [{0}]',github.ref_name),
12- github.event.pull_request.head.ref,
13- github.event.pull_request.base.ref
10+ '{0} - Continuous Testing (Matrix){1}',
11+ github.event_name == 'pull_request'
12+ && format('PR#{0}{1}',github.event.number, github.event.pull_request.draft && ' [DRAFT]' || '')
13+ || format('Push [{0}]', github.ref_name),
14+ github.event_name == 'pull_request'
15+ && format(' - [{0}-to-{1}]', github.event.pull_request.head.ref, github.event.pull_request.base.ref)
16+ || ''
1417 )
1518 }}
1619
1720on :
21+ push :
22+ branches :
23+ - main
24+ - develop
1825 pull_request :
1926 branches :
2027 - main
28+ - develop
2129 types :
2230 - opened
2331 - reopened
2432 - synchronize
2533 - ready_for_review
34+ # Trigger if target branch was changed to a trunk
35+ pull_request_target :
36+ types :
37+ - edited
38+ branches :
39+ - main
40+ - develop
2641
2742env :
2843 build_directory : Build
@@ -33,9 +48,9 @@ concurrency:
3348 cancel-in-progress : true
3449
3550jobs :
36- buildAndRunTests :
37- name : Continuous Testing
38- permissions :
51+ tests :
52+ name : Continuous Testing # Note: This name & matrix are used within the status checks - do not change
53+ permissions :
3954 contents : read # Read access to code and content in the repository
4055 pull-requests : read # Read access to pull request metadata for the event
4156 checks : write # Write access to report check results
4863 dotnet-version : ["8.0.x"]
4964
5065 steps :
51- - name : Checkout [${{ github.event.pull_request.head.ref }}]
66+ - name : ${{ format(' Checkout [{0}]', github.event_name == 'pull_request' && github. event.pull_request.head.ref || github.ref_name) }}
5267 uses : actions/checkout@v4
5368 with :
5469 ref : ${{ github.event.pull_request.head.ref }}
@@ -87,17 +102,14 @@ jobs:
87102 # ## Prepare to Run Tests ###
88103 # ###################################################################################################
89104 - name : Setup .NET [${{ matrix.dotnet-version }}]
90- if : ${{ !fromJSON(steps.getCanSkip.outputs.result) }}
91105 uses : actions/setup-dotnet@v4
92106 with :
93107 dotnet-version : ${{ matrix.dotnet-version }}
94108
95109 - name : Setup NuGet
96- if : ${{ !fromJSON(steps.getCanSkip.outputs.result) }}
97110 uses : NuGet/setup-nuget@v2.0.0
98111
99112 - name : Restore NuGet
100- if : ${{ !fromJSON(steps.getCanSkip.outputs.result) }}
101113 run : nuget restore
102114
103115 - name : Restore Dependencies
0 commit comments