-
Notifications
You must be signed in to change notification settings - Fork 12
83 lines (68 loc) · 2.72 KB
/
ci.yml
File metadata and controls
83 lines (68 loc) · 2.72 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
76
77
78
79
80
81
82
83
name: "CI"
on:
push:
branches: [ master ]
paths-ignore:
- 'docs/**'
pull_request:
workflow_dispatch:
jobs:
build:
name: 'Build'
runs-on: 'ubuntu-latest'
services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2025-latest
ports:
- 1433:1433
env:
ACCEPT_EULA: 'Y'
MSSQL_SA_PASSWORD: 'IntegrationTestsDbPassword85!'
MSSQL_COLLATION: 'Latin1_General_CI_AS_KS'
options: >-
--health-cmd="/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P IntegrationTestsDbPassword85! -C -Q 'SELECT 1' || exit 1"
--health-interval=10s
--health-timeout=5s
--health-retries=5
--health-start-period=30s
steps:
- name: 'Checkout'
uses: actions/checkout@v6
# Temporary workaround: --skipApiVersionCheck is needed until Azurite supports the latest Azure Storage API version
# See: https://github.com/Azure/Azurite/issues/2623
- name: 'Start Azurite'
run: |
docker run -d \
-p 10000:10000 \
-p 10001:10001 \
-p 10002:10002 \
mcr.microsoft.com/azure-storage/azurite:latest \
azurite --skipApiVersionCheck --blobHost 0.0.0.0 --queueHost 0.0.0.0 --tableHost 0.0.0.0
- name: 'Install dotnet'
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json
- name: 'Restore packages'
run: dotnet restore --locked-mode
- name: 'Install sqlpackage'
run: dotnet tool install -g microsoft.sqlpackage
- name: 'Build project'
run: dotnet build --no-restore --configuration Debug
- name: Test
run: dotnet test --no-build --no-restore --configuration Debug --report-trx --coverage --crashdump --crashdump-type mini --hangdump --hangdump-timeout 10m --hangdump-type mini --minimum-expected-tests 1
# see https://github.com/dorny/test-reporter?tab=readme-ov-file#recommended-setup-for-public-repositories
- uses: actions/upload-artifact@v7 # upload test results
if: success() || failure() # run this step even if previous step failed
with:
name: test-results
path: "**/*.trx"
- name: Install dotnet-coverage
run: dotnet tool install -g dotnet-coverage
- name: Convert coverage to cobertura
run: dotnet-coverage merge **/*.coverage -f cobertura -o coverage.cobertura.xml
- name: Create code coverage report
run: |
dotnet tool install -g dotnet-reportgenerator-globaltool
reportgenerator -reports:coverage.cobertura.xml -targetdir:CodeCoverage -reporttypes:'MarkdownSummaryGithub;Cobertura'
- name: Write to Job Summary
run: cat CodeCoverage/SummaryGithub.md >> $GITHUB_STEP_SUMMARY