Skip to content

Commit

Permalink
Fixed build script to fail on process fail, and split Website tess fr…
Browse files Browse the repository at this point in the history
…om API tests.
  • Loading branch information
jezzsantos committed Feb 21, 2025
1 parent 343f39d commit 9893403
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ env:
DOTNET_VERSION: 8.0.302
NODEJS_VERSION: '22'

# We want failed commands to fail the pipeline on Windows
defaults:
run:
shell: bash

jobs:
build:
runs-on: windows-latest
Expand All @@ -32,13 +37,13 @@ jobs:
- name: Restore dependencies
run: dotnet restore "${{env.SOLUTION_PATH}}"
- name: Build (Backend) for Azure Testing
run: dotnet build --configuration ${{env.TESTINGONLY_BUILD_CONFIGURATION}} "${{env.SOLUTION_PATH}}" /p:HostingPlatform=HOSTEDONAZURE
run: dotnet build --configuration ${{env.TESTINGONLY_BUILD_CONFIGURATION}} "${{env.SOLUTION_PATH}}" -p:HostingPlatform=HOSTEDONAZURE
- name: Build (Backend) for AWS Testing
run: dotnet build --configuration ${{env.TESTINGONLY_BUILD_CONFIGURATION}} "${{env.SOLUTION_PATH}}" /p:HostingPlatform=HOSTEDONAWS
run: dotnet build --configuration ${{env.TESTINGONLY_BUILD_CONFIGURATION}} "${{env.SOLUTION_PATH}}" -p:HostingPlatform=HOSTEDONAWS
- name: Build (Backend) for Azure Deploy
run: dotnet build --configuration ${{env.DEPLOY_BUILD_CONFIGURATION}} "${{env.SOLUTION_PATH}}" /p:HostingPlatform=HOSTEDONAZURE
run: dotnet build --configuration ${{env.DEPLOY_BUILD_CONFIGURATION}} "${{env.SOLUTION_PATH}}" -p:HostingPlatform=HOSTEDONAZURE
- name: Build (Backend) for AWS Deploy
run: dotnet build --configuration ${{env.DEPLOY_BUILD_CONFIGURATION}} "${{env.SOLUTION_PATH}}" /p:HostingPlatform=HOSTEDONAWS
run: dotnet build --configuration ${{env.DEPLOY_BUILD_CONFIGURATION}} "${{env.SOLUTION_PATH}}" -p:HostingPlatform=HOSTEDONAWS
- name: Build WebsiteHost (FrontEnd) for Deploy
run: |
cd src/WebsiteHost/ClientApp
Expand All @@ -65,7 +70,7 @@ jobs:
- 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
run: dotnet build --configuration ${{env.TESTINGONLY_BUILD_CONFIGURATION}} "${{env.SOLUTION_PATH}}" -p:HostingPlatform=HOSTEDONAZURE
- name: Unit Test (Backend)
continue-on-error: false
run: >
Expand All @@ -75,12 +80,21 @@ jobs:
--logger:"trx"
--logger:"junit;LogFileName={assembly}.junit.xml;MethodFormat=Class;FailureBodyFormat=Verbose"
--test-adapter-path:. "${{env.SOLUTION_PATH}}"
- name: Integration Test (Backend)
continue-on-error: true
- name: Integration Test (Backend API)
continue-on-error: false
run: >
dotnet test --no-build --verbosity normal
--configuration ${{env.TESTINGONLY_BUILD_CONFIGURATION}}
--filter:"Category=Integration.API" --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 (Backend Website)
continue-on-error: true # These tests can be flaky sometimes
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"
--filter:"Category=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}}"
Expand Down

0 comments on commit 9893403

Please sign in to comment.