Repository navigation
76 lines (61 loc) · 2.62 KB
/
Copy pathpullrequest.yml
File metadata and controls
76 lines (61 loc) · 2.62 KB
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 Pull Requests
on:
pull_request:
branches:
- main
jobs:
build:
name: "Build and Test Pull Requests"
env:
ASPNETCORE_ENVIRONMENT: "Production"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- name: Restore Nuget Packages
run: dotnet restore CallbackHandler.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
- name: Build Code
run: dotnet build CallbackHandler.sln --configuration Release
- name: Run Unit Tests
run: |
echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
dotnet test "CallbackHandler.BusinessLogic.Tests/CallbackHandler.BusinessLogic.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx
dotnet test "CallbackHandler.CallbackMessageAggregate.Tests/CallbackHandler.CallbackMessageAggregate.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx
dotnet test "CallbackHandler.Tests/CallbackHandler.Tests.csproj" --configuration Release --no-build --verbosity normal -- --report-xunit-trx
- name: Build Docker Image
run: docker build . --file CallbackHandler/Dockerfile --tag callbackhandler:latest
- name: Run Integration Tests
run: dotnet test "CallbackHandler.IntegrationTests/CallbackHandler.IntegrationTests.csproj" --configuration Release --no-build --verbosity normal --results-directory "${{ github.workspace }}/TestResults" --settings "CallbackHandler.IntegrationTests/Integration.runsettings"
- uses: actions/upload-artifact@v4.4.0
with:
name: tracelogs
path: /home/runner/trace/
- name: Publish test results
uses: dorny/test-reporter@v1
if: always()
with:
name: Unit Test Results
path: '**/TestResults/*.trx'
reporter: dotnet-trx
fail-on-error: true
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: '**/TestResults/*.trx'
retention-days: 30
- name: Publish integration test results
uses: dorny/test-reporter@v1
if: always()
with:
name: Integration Test Results
path: 'TestResults/CallbackHandler.IntegrationTests.xml'
reporter: dotnet-nunit
fail-on-error: true
- name: Upload integration test results
uses: actions/upload-artifact@v4
if: always()
with:
name: integration-test-results
path: 'TestResults/CallbackHandler.IntegrationTests.xml'
retention-days: 30