-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (49 loc) · 2.48 KB
/
pullrequest.yml
File metadata and controls
61 lines (49 loc) · 2.48 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
name: Build and Test Pull Requests
on:
pull_request:
branches:
- master
jobs:
build:
name: "Build and Test Pull Requests"
env:
ASPNETCORE_ENVIRONMENT: "Production"
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Restore Nuget Packages
run: dotnet restore MessagingService.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}
- name: Build Code
run: dotnet build MessagingService.sln --configuration Release
- name: Run Unit Tests
run: |
echo "ASPNETCORE_ENVIRONMENT are > ${ASPNETCORE_ENVIRONMENT}"
dotnet test "MessagingService.BusinessLogic.Tests\MessagingService.BusinessLogic.Tests.csproj" --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=businesslogic-test-results.trx"
dotnet test "MessagingService.EmailAggregate.Tests\MessagingService.EmailAggregate.Tests.csproj" --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=email-aggregate-test-results.trx"
dotnet test "MessagingService.SMSAggregate.Tests\MessagingService.SMSAggregate.Tests.csproj" --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=sms-aggregate-test-results.trx"
dotnet test "MessagingService.Tests\MessagingService.Tests.csproj" --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=service-test-results.trx"
- name: Build Docker Image
env:
GITHUBTOKEN: ${{ secrets.PRIVATEFEED_APIKEY }}
run: docker build . --file MessagingService/Dockerfile --tag messagingservice:latest --build-arg NUGET_TOKEN=${{ secrets.PRIVATEFEED_APIKEY }}
- name: Run Integration Tests
run: dotnet test "MessagingService.IntegrationTests\MessagingService.IntegrationTests.csproj" --filter Category=PRTest --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=integration-test-results.trx"
- uses: actions/[email protected]
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