-
-
Notifications
You must be signed in to change notification settings - Fork 13
75 lines (71 loc) · 3.09 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Build and Test
on: [ push, pull_request ]
permissions:
contents: read
actions: read
checks: write
env:
IS_CI_BUILD: 'true'
SOLUTION_PATH: 'src/SaaStack.sln'
TESTINGONLY_BUILD_CONFIGURATION: 'Release'
DEPLOY_BUILD_CONFIGURATION: 'ReleaseForDeploy'
DOTNET_VERSION: 8.0.200
jobs:
build:
runs-on: windows-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{env.DOTNET_VERSION}}
- name: Restore dependencies
run: dotnet restore "${{env.SOLUTION_PATH}}"
- name: Build for Azure Testing
run: dotnet build --configuration ${{env.TESTINGONLY_BUILD_CONFIGURATION}} "${{env.SOLUTION_PATH}}" /p:HostingPlatform=HOSTEDONAZURE
- name: Build for AWS Testing
run: dotnet build --configuration ${{env.TESTINGONLY_BUILD_CONFIGURATION}} "${{env.SOLUTION_PATH}}" /p:HostingPlatform=HOSTEDONAWS
- name: Build for Azure Deploy
run: dotnet build --configuration ${{env.DEPLOY_BUILD_CONFIGURATION}} "${{env.SOLUTION_PATH}}" /p:HostingPlatform=HOSTEDONAZURE
- name: Build for AWS Deploy
run: dotnet build --configuration ${{env.DEPLOY_BUILD_CONFIGURATION}} "${{env.SOLUTION_PATH}}" /p:HostingPlatform=HOSTEDONAWS
test:
runs-on: windows-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{env.DOTNET_VERSION}}
- name: Restore dependencies
run: dotnet restore "${{env.SOLUTION_PATH}}"
- name: Build for CI Testing (for Azure)
run: dotnet build --configuration ${{env.TESTINGONLY_BUILD_CONFIGURATION}} "${{env.SOLUTION_PATH}}" /p:HostingPlatform=HOSTEDONAZURE
- name: Unit Test
continue-on-error: false
run: >
dotnet test --no-build --verbosity normal
--configuration ${{env.TESTINGONLY_BUILD_CONFIGURATION}}
--filter:"Category=Unit|Category=Unit.Tooling|Category=Unit.Architecture" --collect:"XPlat Code Coverage" --results-directory:"src/TestResults/csharp"
--logger:"trx"
--logger:"junit;LogFileName={assembly}.junit.xml;MethodFormat=Class;FailureBodyFormat=Verbose"
--test-adapter-path:. "${{env.SOLUTION_PATH}}"
- name: Integration Test
continue-on-error: true
run: >
dotnet test --no-build --verbosity normal
--configuration ${{env.TESTINGONLY_BUILD_CONFIGURATION}}
--filter:"Category=Integration.API|Category=Integration.Website" --collect:"XPlat Code Coverage" --results-directory:"src/TestResults/csharp"
--logger:"trx"
--logger:"junit;LogFileName={assembly}.junit.xml;MethodFormat=Class;FailureBodyFormat=Verbose"
--test-adapter-path:. "${{env.SOLUTION_PATH}}"
- name: Testing Report
uses: dorny/[email protected]
if: success() || failure()
with:
name: All Tests
path: 'src/TestResults/csharp/**/*.trx'
reporter: dotnet-trx
fail-on-error: 'false'