@@ -19,51 +19,32 @@ jobs:
1919 steps :
2020 - uses : actions/setup-dotnet@v3
2121 with :
22- dotnet-version : ' 8.0.x'
23-
22+ dotnet-version : ' 8.0.x'
2423 - name : Check out code
2524 uses : actions/checkout@v3
2625 with :
27- path : working-dir
28-
26+ path : working-dir
2927 - name : Restore
30- run : dotnet restore ./working-dir/KeeperData.Api.sln
31-
28+ run : dotnet restore ./working-dir/KeeperData.Api.sln
3229 - name : Build
33- run : dotnet build ./working-dir/KeeperData.Api.sln --configuration Release --no-restore -warnaserror
34-
30+ run : dotnet build ./working-dir/KeeperData.Api.sln --configuration Release --no-restore -warnaserror
3531 - name : Verify format
3632 run : dotnet format ./working-dir/KeeperData.Api.sln --verify-no-changes --verbosity diagnostic
37-
38- - name : Make localstack init script executable
39- run : chmod +x ./working-dir/compose/start-localstack.sh
40-
41- - name : Make script executable
42- run : chmod +x ./working-dir/wait-for-docker-logs.sh
43-
44- - name : Run docker-compose
45- uses : hoverkraft-tech/compose-action@v2.0.1
46- with :
47- compose-file : |
48- ./working-dir/docker-compose.yml
49- ./working-dir/docker-compose.override.yml
50-
51- - name : Wait for localstack
52- run : ./working-dir/wait-for-docker-logs.sh localstack-emulator "Bootstrapping Complete" 60
53-
54- - name : Test
55- run : dotnet test ./working-dir/KeeperData.Api.sln --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory ./coverage
56-
57- - name : install dotnet coverage
58- run : dotnet tool install --global dotnet-coverage
59-
60- - name : merge coverage reports
61- run : dotnet-coverage merge *.cobertura.xml --recursive --output merged.cobertura.xml --output-format cobertura
62-
33+ - name : Test (unit and component)
34+ run : dotnet test ./working-dir/KeeperData.Api.sln --filter "Category!=Integration" --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --collect:"XPlat Code Coverage" --results-directory ./coverage
35+ - name : Install ReportGenerator
36+ run : dotnet tool install --global dotnet-reportgenerator-globaltool
37+ - name : Generate Coverage Summary
38+ run : |
39+ reportgenerator \
40+ -reports:"./coverage/**/coverage.cobertura.xml" \
41+ -targetdir:"coverage-report" \
42+ -reporttypes:"Cobertura;MarkdownSummary" \
43+ -assemblyfilters:+KeeperData.*
6344 - name : Code coverage report
6445 uses : irongut/CodeCoverageSummary@v1.3.0
6546 with :
66- filename : merged.cobertura .xml
47+ filename : coverage-report/Cobertura .xml
6748 badge : true
6849 fail_below_min : false
6950 format : markdown
@@ -72,14 +53,41 @@ jobs:
7253 indicators : true
7354 output : both
7455 thresholds : ' 60 80'
75-
7656 - name : Add Coverage PR Comment
7757 uses : marocchino/sticky-pull-request-comment@v2
7858 if : github.event_name == 'pull_request'
7959 with :
8060 recreate : true
8161 path : code-coverage-results.md
8262
63+ integration-tests :
64+ name : Run Integration Tests
65+ runs-on : ubuntu-latest
66+ needs : pr-validator
67+ steps :
68+ - uses : actions/setup-dotnet@v3
69+ with :
70+ dotnet-version : ' 8.0.x'
71+ - name : Check out code
72+ uses : actions/checkout@v3
73+ with :
74+ path : working-dir
75+ - name : Make LocalStack init script executable
76+ run : chmod +x ./working-dir/compose/start-localstack.sh
77+ - name : Run docker-compose
78+ uses : hoverkraft-tech/compose-action@v2.0.1
79+ with :
80+ compose-file : |
81+ ./working-dir/docker-compose.yml
82+ ./working-dir/docker-compose.override.yml
83+ - name : Make script executable
84+ run : chmod +x ./working-dir/wait-for-docker-logs.sh
85+ - name : Wait for localstack
86+ run : ./working-dir/wait-for-docker-logs.sh localstack-emulator "Bootstrapping Complete" 60
87+ - name : Wait for keeperdata_api to be ready
88+ run : ./working-dir/wait-for-docker-logs.sh keeperdata_api "Now listening on" 60
89+ - name : Run integration tests
90+ run : dotnet test ./working-dir/KeeperData.Api.sln --filter "Category=Integration"
8391
8492 # # SonarCloud
8593 # # Uncomment to unable SonarCloud scan
0 commit comments