forked from bitfoundation/bitplatform
-
Notifications
You must be signed in to change notification settings - Fork 0
227 lines (195 loc) · 9.41 KB
/
bit.full.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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
name: bit platform full CI
on:
workflow_dispatch:
env:
ConnectionStrings__SqlServerConnectionString: 'Data Source=localhost; Initial Catalog=BoilerplateTestDb;Application Name=Boilerplate;TrustServerCertificate=True;User Id=sa;Password=P@ssw0rdP@ssw0rd;'
SIMPLE_TEST_FILTER: "ClassName!~PageTests"
BLAZOR_SERVER_TEST_FILTER: "ClassName~PageTests.BlazorServer"
BLAZOR_WASM_TEST_FILTER: "ClassName~PageTests.BlazorWebAssembly"
MULTILINGUAL_DISABLED_TEST_FILTER: "ClassName!~LocalizationTests|TestCategory=MultilingualDisabled"
jobs:
build:
name: build and test
runs-on: ubuntu-24.04
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: src/global.json
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Uninstall Bit.Boilerplate if running on ACT
continue-on-error: true
if: ${{ env.ACT }}
run: dotnet new uninstall Bit.Boilerplate
- name: Prepare environment
run: |
cd src/Templates/Boilerplate && dotnet build -c Release
dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0
dotnet new install Bit.Boilerplate.0.0.0.nupkg && cd ../../../
dotnet workload install maui-tizen maui-android wasm-tools wasm-tools-net8
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT "platform-tools"
- name: Install sql server
uses: potatoqualitee/[email protected]
with:
install: sqlengine
sa-password: P@ssw0rdP@ssw0rd
show-log: true
- name: Simple tests (no --advancedTests)
id: simple-test
continue-on-error: true
run: |
dotnet new bit-bp --name SimpleTest --database Sqlite --framework net8.0
cd SimpleTest/src/Server/SimpleTest.Server.Api/
dotnet tool restore
dotnet ef migrations add InitialMigration --verbose
dotnet ef database update
cd ../../Tests
dotnet build
pwsh bin/Debug/net8.0/playwright.ps1 install --with-deps
dotnet test --logger GitHubActions --filter "${{ env.SIMPLE_TEST_FILTER }}"
- name: Upload Tests Artifact
uses: actions/[email protected]
if: ${{ !env.ACT && failure() && steps.simple-test.conclusion == 'failure' }}
with:
name: tests-artifact
path: ./SimpleTest/src/Tests/TestResults
retention-days: 14
- name: Test Sqlite database option
id: sqlite-test
continue-on-error: true
run: |
dotnet new bit-bp --name TestSqlite --database Sqlite --advancedTests --framework net9.0
cd TestSqlite/src/Server/TestSqlite.Server.Api/
dotnet tool restore
dotnet ef migrations add InitialMigration --verbose
dotnet ef database update
cd ../../Tests
dotnet build
pwsh bin/Debug/net9.0/playwright.ps1 install --with-deps
dotnet test --logger GitHubActions --filter "${{ env.BLAZOR_SERVER_TEST_FILTER }}"
dotnet test --logger GitHubActions --filter "${{ env.BLAZOR_WASM_TEST_FILTER }}" -- MSTest.Parallelize.Workers=1
- name: Upload Tests Artifact
uses: actions/[email protected]
if: ${{ !env.ACT && failure() && steps.sqlite-test.conclusion == 'failure' }}
with:
name: tests-artifact
path: ./TestSqlite/src/Tests/TestResults
retention-days: 14
- name: Test SqlServer database option
id: sqlserver-test
continue-on-error: true
run: |
dotnet new bit-bp --name TestSqlServer --database SqlServer --advancedTests --framework net8.0
cd TestSqlServer/src/Server/TestSqlServer.Server.Api/
dotnet tool restore
dotnet ef migrations add InitialMigration --verbose
dotnet ef database update
cd ../../Tests
dotnet test --logger GitHubActions --filter "${{ env.BLAZOR_SERVER_TEST_FILTER }}"
dotnet test --logger GitHubActions --filter "${{ env.BLAZOR_WASM_TEST_FILTER }}" -- MSTest.Parallelize.Workers=1
- name: Upload Tests Artifact
uses: actions/[email protected]
if: ${{ !env.ACT && failure() && steps.sqlserver-test.conclusion == 'failure' }}
with:
name: tests-artifact
path: ./TestSqlServer/src/Tests/TestResults
retention-days: 14
- name: Test Multilingual disabled option
id: multilingual-disabled-test
continue-on-error: true
run: |
dotnet new bit-bp --name MultilingualDisabled --database Sqlite --advancedTests --framework net8.0
cd MultilingualDisabled/src/Server/MultilingualDisabled.Server.Api/
dotnet tool restore
dotnet ef migrations add InitialMigration --verbose
dotnet ef database update
cd ../../Tests
dotnet test -p:MultilingualEnabled=false --logger GitHubActions --filter "${{ env.MULTILINGUAL_DISABLED_TEST_FILTER }}" -- MSTest.Parallelize.Workers=1
- name: Upload Tests Artifact
uses: actions/[email protected]
if: ${{ !env.ACT && failure() && steps.multilingual-disabled-test.conclusion == 'failure' }}
with:
name: tests-artifact
path: ./MultilingualDisabled/src/Tests/TestResults
retention-days: 14
- name: Test PostgreSQL, MySql, Other database options
continue-on-error: true
run: |
dotnet new bit-bp --name TestPostgreSQL --database PostgreSQL --framework net8.0 --signalR
cd TestPostgreSQL/src/Server/TestPostgreSQL.Server.Web/
dotnet build
cd ../../../../
dotnet new bit-bp --name TestMySql --database MySql --framework net8.0 --sample Admin --offlineDb
cd TestMySql/src/Server/TestMySql.Server.Web/
dotnet build
cd ../../../../
dotnet new bit-bp --name TestOther --database Other --framework net9.0 --sample Todo --sentry
cd TestOther/src/Server/TestOther.Server.Web/
dotnet build
- name: Test file storage options
continue-on-error: true
run: |
dotnet new bit-bp --name TestLocal --filesStorage Local --framework net8.0 --appInsights
cd TestLocal/src/Server/TestLocal.Server.Web/
dotnet build
cd ../../../../
dotnet new bit-bp --name TestAzureBlobStorage --filesStorage AzureBlobStorage --framework net9.0 --captcha reCaptcha --notification
cd TestAzureBlobStorage/src/Server/TestAzureBlobStorage.Server.Web/
dotnet build
- name: Test backend setup options
continue-on-error: true
run: |
dotnet new bit-bp --name TestStandalone --api Standalone --framework net8.0
cd TestStandalone/src/Server/TestStandalone.Server.Web/
dotnet build
cd ../
cd TestStandalone.Server.Web/
dotnet build
cd ../../../../
dotnet new bit-bp --name TestIntegrated --api Integrated --framework net9.0
cd TestIntegrated/src/Server/TestIntegrated.Server.Web/
dotnet build
- name: Test sample configuration 1
continue-on-error: true
run: |
dotnet new bit-bp --name TestProject --database SqlServer --filesStorage AzureBlobStorage --api Integrated --captcha reCaptcha --pipeline Azure --sample Admin --offlineDb --windows --appInsights --sentry --signalR --notification --framework net9.0
dotnet build TestProject/TestProject.sln -p:MultilingualEnabled=true -p:PwaEnabled=true -p:Environment=Staging
- name: Test sample configuration 2
continue-on-error: true
run: |
dotnet new bit-bp --name TestProject2 --database Other --filesStorage Other --api Standalone --captcha None --pipeline None --sample None --offlineDb false --windows false --appInsights false --sentry false --signalR false --notification false --framework net8.0
dotnet build TestProject2/TestProject2.sln -p:MultilingualEnabled=false -p:PwaEnabled=false -p:Environment=Development
- name: Run BeforeBuildTasks
continue-on-error: true # Error MSB4057, not all csproj files have BeforeBuildTasks target.
run: dotnet build src/Bit-CI-release.sln -t:BeforeBuildTasks -m:1 -f net9.0
- name: Release build bit blazor ui + butil + bswup + besql + bup + code analyzers + source generators
run: dotnet build src/Bit-CI-release.sln -c Release
- name: Build careers, platform, sales websites
run: |
dotnet build src/Websites/Platform/Bit.Websites.Platform.sln
dotnet build src/Websites/Careers/Bit.Websites.Careers.sln
dotnet build src/Websites/Sales/Bit.Websites.Sales.sln
- name: Run bit blazor ui tests
run: dotnet test src/BlazorUI/Bit.BlazorUI.Tests/Bit.BlazorUI.Tests.csproj
- name: Build bit blazor ui demo
run: dotnet build src/BlazorUI/Bit.BlazorUI.sln
- name: Create projects from BlazorEmpty project template with different parameters
run: |
cd src/Templates/BlazorEmpty && dotnet build -c Release
dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0
dotnet new install Bit.BlazorEmpty.0.0.0.nupkg && cd ../../../
dotnet new bit-empty --name AutoGlobal --interactivity Auto --all-interactive --framework net9.0
dotnet new bit-empty --name SsrPerPage --interactivity None --framework net8.0
- name: Build blazor empty based projects
run: |
dotnet build AutoGlobal/AutoGlobal.sln
dotnet build SsrPerPage/SsrPerPage.csproj