Skip to content

Commit

Permalink
Fix exception name + add CI for pull requests (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeeyo authored Feb 1, 2023
1 parent 6f9ff45 commit 3e6375e
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/manual-publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: .NET Core Build and Publish

on:
push:

env:
NETCORE_VERSION: '3.1.x'
NETCORE_VERSION: '7.0'
GIT_REPO_ROOT: src
MAJOR_MINOR_VERSION: 1.0.
SOLUTION_FILE: DotnetBuildMetrics.sln
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: .NET Core Build

on:
pull_request:

env:
NETCORE_VERSION: '7.0'
GIT_REPO_ROOT: src
SOLUTION_FILE: DotnetBuildMetrics.sln
DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX: 2

jobs:

build:
name: Build Package
runs-on: windows-latest # using windows agent for net472 build.

steps:
- uses: actions/checkout@v2
- name: Setup .NET Core SDK ${{ env.NETCORE_VERSION }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.NETCORE_VERSION }}

- name: Restore
working-directory: ${{ env.GIT_REPO_ROOT }}
run: dotnet restore ${{ env.SOLUTION_FILE }}

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1

- name: Build
working-directory: ${{ env.GIT_REPO_ROOT }}
run: dotnet build ${{ env.SOLUTION_FILE }} --configuration Debug --no-restore
2 changes: 1 addition & 1 deletion src/Agoda.Builds.Metrics/MeasureBuildTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public override bool Execute()

DevFeedbackPublisher.Publish(ApiEndPoint, data);
}
catch (GitContextNotFoundException ex)
catch (GitContextException ex)
{
Log.LogMessage($"The build time will not be published: {ex.Message}");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void OnStarted()
{
TimedStartupPublisher.Publish(type: ".AspNetStartup", timeTaken: diff);
}
catch (GitContextNotFoundException ex)
catch (GitContextException ex)
{
_logger.LogInformation("The startup time will not be published: {reason}", ex.Message);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public async Task Invoke(HttpContext httpContext)
{
TimedStartupPublisher.Publish(type: ".AspNetResponse", timeTaken: diff);
}
catch (GitContextNotFoundException ex)
catch (GitContextException ex)
{
_logger.LogInformation("The startup time until first response will not be published: {reason}", ex.Message);
}
Expand Down

0 comments on commit 3e6375e

Please sign in to comment.