-
Notifications
You must be signed in to change notification settings - Fork 38
197 lines (163 loc) · 8.03 KB
/
CI.yml
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
env:
APPLICATIONINSIGHTS_CONNECTION_STRING: ${{ secrets.APPLICATIONINSIGHTS_CONNECTION_STRING }}
My_Hr_ConnectionStrings__Database: Data Source=localhost,1433;Initial Catalog=My.Hr;User id=sa;Password=sAPWD23.^0;TrustServerCertificate=true
MyEf_Hr_ConnectionStrings__Database: Data Source=localhost,1433;Initial Catalog=MyEf.Hr;User id=sa;Password=sAPWD23.^0;TrustServerCertificate=true
Bar_ConnectionStrings__Database: Data Source=localhost,1433;Initial Catalog=Foo.Bar;User id=sa;Password=sAPWD23.^0;TrustServerCertificate=true
services:
sql:
image: mcr.microsoft.com/mssql/server:2019-latest
ports:
- 1433:1433
env:
ACCEPT_EULA: Y
SA_PASSWORD: sAPWD23.^0
options: --name sqlserver
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
7.0.x
# Tools
- name: Tools restore
run: |
dotnet restore ./tools/Beef.CodeGen.Core
dotnet restore ./tools/Beef.Database.Core
dotnet restore ./tools/Beef.Database.SqlServer
dotnet restore ./tools/Beef.Database.MySql
dotnet restore ./tools/Beef.Test.NUnit
dotnet restore ./templates/Beef.Template.Solution
- name: Tools build
run: |
dotnet build ./tools/Beef.CodeGen.Core --no-restore
dotnet build ./tools/Beef.Database.Core --no-restore
dotnet build ./tools/Beef.Database.SqlServer --no-restore
dotnet build ./tools/Beef.Database.MySql --no-restore
dotnet build ./tools/Beef.Test.NUnit --no-restore
dotnet build ./templates/Beef.Template.Solution --no-restore
- name: Tools NuGet publish (local)
run: |
mkdir ./packages
dotnet pack ./tools/Beef.CodeGen.Core --output ./packages --configuration Debug --no-build
dotnet pack ./tools/Beef.Database.Core --output ./packages --configuration Debug --no-build
dotnet pack ./tools/Beef.Database.SqlServer --output ./packages --configuration Debug --no-build
dotnet pack ./tools/Beef.Database.MySql --output ./packages --configuration Debug --no-build
dotnet pack ./tools/Beef.Test.NUnit --output ./packages --configuration Debug --no-build
dotnet pack ./templates/Beef.Template.Solution --output ./packages --configuration Debug --no-build
dotnet new nugetconfig
dotnet nuget add source ./packages
# Samples/Demo
- name: Samples/Demo restore
run: |
dotnet restore ./samples/Demo/Beef.Demo.CodeGen
dotnet restore ./samples/Demo/Beef.Demo.Database
dotnet restore ./samples/Demo/Beef.Demo.Common
dotnet restore ./samples/Demo/Beef.Demo.Business
dotnet restore ./samples/Demo/Beef.Demo.Api
dotnet restore ./samples/Demo/Beef.Demo.Abc.Database
dotnet restore ./samples/Demo/Beef.Demo.Test
- name: Samples/Demo build
run: |
dotnet build ./samples/Demo/Beef.Demo.CodeGen --no-restore
dotnet build ./samples/Demo/Beef.Demo.Database --no-restore
dotnet build ./samples/Demo/Beef.Demo.Common --no-restore
dotnet build ./samples/Demo/Beef.Demo.Business --no-restore
dotnet build ./samples/Demo/Beef.Demo.Api --no-restore
dotnet build ./samples/Demo/Beef.Demo.Abc.Database --no-restore
dotnet build ./samples/Demo/Beef.Demo.Test --no-restore
# Samples/Cdr.Banking
- name: Samples/Cdr.Banking restore
run: |
dotnet restore ./samples/Cdr.Banking/Cdr.Banking.CodeGen
dotnet restore ./samples/Cdr.Banking/Cdr.Banking.Common
dotnet restore ./samples/Cdr.Banking/Cdr.Banking.Business
dotnet restore ./samples/Cdr.Banking/Cdr.Banking.Api
dotnet restore ./samples/Cdr.Banking/Cdr.Banking.Test
- name: Samples/Cdr.Banking build
run: |
dotnet build ./samples/Cdr.Banking/Cdr.Banking.CodeGen --no-restore
dotnet build ./samples/Cdr.Banking/Cdr.Banking.Common --no-restore
dotnet build ./samples/Cdr.Banking/Cdr.Banking.Business --no-restore
dotnet build ./samples/Cdr.Banking/Cdr.Banking.Api --no-restore
dotnet build ./samples/Cdr.Banking/Cdr.Banking.Test --no-restore
# Samples/My.Hr
- name: Samples/My.Hr restore
run: |
dotnet restore ./samples/My.Hr/My.Hr.CodeGen
dotnet restore ./samples/My.Hr/My.Hr.Database
dotnet restore ./samples/My.Hr/My.Hr.Common
dotnet restore ./samples/My.Hr/My.Hr.Business
dotnet restore ./samples/My.Hr/My.Hr.Api
dotnet restore ./samples/My.Hr/My.Hr.Test
- name: Samples/My.Hr build
run: |
dotnet build ./samples/My.Hr/My.Hr.CodeGen --no-restore
dotnet build ./samples/My.Hr/My.Hr.Database --no-restore
dotnet build ./samples/My.Hr/My.Hr.Common --no-restore
dotnet build ./samples/My.Hr/My.Hr.Business --no-restore
dotnet build ./samples/My.Hr/My.Hr.Api --no-restore
dotnet build ./samples/My.Hr/My.Hr.Test --no-restore
- name: Samples/My.Hr database
working-directory: ./samples/My.Hr/My.Hr.Database
run: dotnet run all --connection-varname My_Hr_ConnectionStrings__Database --expect-no-changes --no-build
- name: Samples/My.Hr code-gen
working-directory: ./samples/My.Hr/My.Hr.CodeGen
run: dotnet run all --expect-no-changes --no-build
- name: Samples/My.Hr testing
run: dotnet test ./samples/My.Hr/My.Hr.Test --no-build --verbosity normal
# Samples/MyEf.Hr
- name: Samples/MyEf.Hr restore
run: |
dotnet restore ./samples/MyEf.Hr/MyEf.Hr.CodeGen
dotnet restore ./samples/MyEf.Hr/MyEf.Hr.Database
dotnet restore ./samples/MyEf.Hr/MyEf.Hr.Common
dotnet restore ./samples/MyEf.Hr/MyEf.Hr.Business
dotnet restore ./samples/MyEf.Hr/MyEf.Hr.Api
dotnet restore ./samples/MyEf.Hr/MyEf.Hr.Test
dotnet restore ./samples/MyEf.Hr/MyEf.Hr.Security.Subscriptions
dotnet restore ./samples/MyEf.Hr/MyEf.Hr.Security.Test
- name: Samples/MyEf.Hr build
run: |
dotnet build ./samples/MyEf.Hr/MyEf.Hr.CodeGen --no-restore
dotnet build ./samples/MyEf.Hr/MyEf.Hr.Database --no-restore
dotnet build ./samples/MyEf.Hr/MyEf.Hr.Common --no-restore
dotnet build ./samples/MyEf.Hr/MyEf.Hr.Business --no-restore
dotnet build ./samples/MyEf.Hr/MyEf.Hr.Api --no-restore
dotnet build ./samples/MyEf.Hr/MyEf.Hr.Test --no-restore
dotnet build ./samples/MyEf.Hr/MyEf.Hr.Security.Subscriptions --no-restore
dotnet build ./samples/MyEf.Hr/MyEf.Hr.Security.Test --no-restore
- name: Samples/MyEf.Hr database
working-directory: ./samples/MyEf.Hr/MyEf.Hr.Database
run: dotnet run all --connection-varname MyEf_Hr_ConnectionStrings__Database --expect-no-changes --no-build
- name: Samples/MyEf.Hr code-gen
working-directory: ./samples/MyEf.Hr/MyEf.Hr.CodeGen
run: dotnet run all --expect-no-changes --no-build
- name: Samples/MyEf.Hr testing
run: |
dotnet test ./samples/MyEf.Hr/MyEf.Hr.Test --no-build --verbosity normal
dotnet test ./samples/MyEf.Hr/MyEf.Hr.Security.Test --no-build --verbosity normal
# Template - Sql Server with EF
- name: Template/SqlSever/Ef create
run: dotnet new beef --company Foo.Ef --appname Bar --database SqlServer --no-restore --output Foo.Ef.Bar
- name: Template/SqlServer/Ef database
working-directory: ./Foo.Ef.Bar/Bar.Database
run: dotnet run dropandall --connection-varname Bar_ConnectionStrings__Database --accept-prompts
- name: Template/SqlServer/Ef code-gen
working-directory: ./Foo.Ef.Bar/Bar.CodeGen
run: dotnet run all
- name: Template/SqlServer/Ef test
working-directory: ./Foo.Ef.Bar/Bar.Api
run: dotnet test