-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (81 loc) · 2.35 KB
/
ci.yml
File metadata and controls
98 lines (81 loc) · 2.35 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: CI Pipeline
on:
push:
branches: [ develop, master ]
pull_request:
branches: [ develop, master ]
env:
DOTNET_VERSION: '10.0.x'
CONFIGURATION: Release
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
MINVERBUILDMETADATA: build.${{ github.run_number }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history required for MinVer versioning
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore dependencies
run: dotnet restore
- name: Build solution
run: dotnet build --configuration ${{ env.CONFIGURATION }} --no-restore
- name: Pack NuGet package
if: github.event_name == 'push'
run: >
dotnet pack src/EfCoreKit/EfCoreKit.csproj
--configuration ${{ env.CONFIGURATION }}
--no-build
--output ./artifacts
- name: Upload build artifacts
if: github.event_name == 'push'
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: |
./artifacts/*.nupkg
./artifacts/*.snupkg
test:
name: Test
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore dependencies
run: dotnet restore
- name: Build solution
run: dotnet build --configuration ${{ env.CONFIGURATION }} --no-restore
- name: Run integration tests
run: >
dotnet test tests/EfCoreKit.Tests.Integration/EfCoreKit.Tests.Integration.csproj
--configuration ${{ env.CONFIGURATION }}
--no-build
--verbosity normal
--logger "trx;LogFileName=integration-test-results.trx"
--collect:"XPlat Code Coverage"
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: '**/TestResults/*.trx'
- name: Upload code coverage
if: always()
uses: actions/upload-artifact@v4
with:
name: code-coverage
path: '**/TestResults/**/coverage.cobertura.xml'