Skip to content

Commit

Permalink
Add PR build
Browse files Browse the repository at this point in the history
  • Loading branch information
fredimachado committed May 28, 2024
1 parent a436a96 commit ca31756
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: PRs

on:
pull_request:
branches: [ "main" ]
paths-ignore:
- "**/*.md"
- "**/*.gitignore"
- "**/*.gitattributes"

jobs:
build:
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: "./global.json"

- name: Install Aspire workload
run: dotnet workload install aspire

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build -c Release --no-restore /p:CopyLocalLockFileAssemblies=true

- name: Test
id: test
# Note that the space after the last double dash (--) is intentional
run: >
dotnet test --no-restore
--logger console --logger trx --logger html
--logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true"
--results-directory ${{github.workspace}}/TestResults --blame
--
RunConfiguration.CollectSourceInformation=true
- name: Upload Test Results
if: (success() || steps.test.conclusion == 'failure')
uses: actions/upload-artifact@v4
with:
name: TestResults
path: ${{github.workspace}}/TestResults
1 change: 1 addition & 0 deletions NCafe.sln
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
.github\workflows\barista-api.yml = .github\workflows\barista-api.yml
.github\workflows\cashier-api.yml = .github\workflows\cashier-api.yml
.github\workflows\deploy_template.yml = .github\workflows\deploy_template.yml
.github\workflows\pr.yml = .github\workflows\pr.yml
.github\workflows\web-ui.yml = .github\workflows\web-ui.yml
EndProjectSection
EndProject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FakeItEasy" />
<PackageReference Include="GitHubActionsTestLogger">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Shouldly" />
<PackageReference Include="xunit" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
<ItemGroup>
<PackageReference Include="coverlet.collector" />
<PackageReference Include="FakeItEasy" />
<PackageReference Include="GitHubActionsTestLogger">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Shouldly" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FakeItEasy" />
<PackageReference Include="GitHubActionsTestLogger">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.TimeProvider.Testing" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Shouldly" />
Expand Down
4 changes: 4 additions & 0 deletions src/Common/NCafe.Common.Tests/NCafe.Common.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="GitHubActionsTestLogger">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="TngTech.ArchUnitNET.xUnit" />
<PackageReference Include="xunit" />
Expand Down

0 comments on commit ca31756

Please sign in to comment.