Skip to content

Commit 9d9833d

Browse files
committed
create github build
1 parent a0c7801 commit 9d9833d

File tree

7 files changed

+43
-7
lines changed

7 files changed

+43
-7
lines changed

.github/workflows/dotnet.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,48 @@
11
name: Build Project
22

33
env:
4+
ASPNETCORE_ENVIRONMENT: github
45
BUILD_PATH: '${{github.workspace}}/artifacts'
56
BUILD_VERSION: '10.1.${{github.run_number}}'
67
BUILD_INFORMATION: '10.1.${{github.run_number}}+Branch.${{github.ref_name}}.Sha.${{github.sha}}'
78

89
on:
910
push:
1011
branches:
11-
- main
12+
- master
1213
- develop
1314
tags:
1415
- 'v*'
1516
pull_request:
1617
branches:
17-
- main
18+
- master
1819
- develop
1920

2021
jobs:
2122

2223
build:
2324
runs-on: ubuntu-latest
2425

26+
services:
27+
mssql:
28+
image: mcr.microsoft.com/mssql/server:2019-latest
29+
env:
30+
MSSQL_SA_PASSWORD: '!p@ssword'
31+
ACCEPT_EULA: 'Y'
32+
ports:
33+
- 1433:1433
34+
volumes:
35+
- mssql_data:/var/opt/mssql
36+
37+
postgres:
38+
image: postgres
39+
env:
40+
POSTGRES_PASSWORD: '!p@ssword'
41+
ports:
42+
- 5432:5432
43+
volumes:
44+
- postgres_data:/var/lib/postgresql/data
45+
2546
steps:
2647
- name: Checkout
2748
uses: actions/checkout@v3
@@ -39,14 +60,14 @@ jobs:
3960
run: dotnet restore
4061

4162
- name: Build Solution
42-
run: 'dotnet build --no-restore --configuration Release -p:Version="${{env.BUILD_VERSION}}" -p:InformationalVersion="${{env.BUILD_INFORMATION}}"'
63+
run: dotnet build --no-restore --configuration Release -p:Version="${{env.BUILD_VERSION}}" -p:InformationalVersion="${{env.BUILD_INFORMATION}}"
4364

4465
- name: Run Test
4566
run: dotnet test --configuration Release --collect:"XPlat Code Coverage" --settings coverlet.runsettings
4667

4768
- name: Create Packages
4869
if: success() && github.event_name != 'pull_request'
49-
run: 'dotnet pack --configuration Release --include-symbols --include-source --no-build --no-restore --output "${{env.BUILD_PATH}}" -p:PackageVersion="${{env.BUILD_VERSION}}"'
70+
run: dotnet pack --configuration Release --include-symbols --include-source --no-build --no-restore --output "${{env.BUILD_PATH}}" -p:PackageVersion="${{env.BUILD_VERSION}}"
5071

5172
- name: Upload Packages
5273
if: success() && github.event_name != 'pull_request'

FluentCommand.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{38D98603
2121
ProjectSection(SolutionItems) = preProject
2222
appveyor.yml = appveyor.yml
2323
src\Directory.Build.props = src\Directory.Build.props
24+
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
2425
README.md = README.md
2526
EndProjectSection
2627
EndProject

test/FluentCommand.PostgreSQL.Tests/FluentCommand.PostgreSQL.Tests.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
</ItemGroup>
4141

4242
<ItemGroup>
43+
<None Update="appsettings.github.json">
44+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
45+
</None>
4346
<None Update="appsettings.appveyor.json">
4447
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
4548
</None>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"ConnectionStrings": {
3+
"Tracker": "Server=localhost;Port=5432;Database=TrackerTest;User Id=postgres;Password=!p@ssword;"
4+
}
5+
}

test/FluentCommand.SqlServer.Tests/DatabaseFixture.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ private void ResolveConnectionString()
6464

6565
var configuration = builder.Build();
6666

67-
var connectionString = configuration.GetConnectionString(ConnectionName);
68-
69-
ConnectionString = connectionString;
67+
ConnectionString = configuration.GetConnectionString(ConnectionName);
7068
}
7169

7270

test/FluentCommand.SqlServer.Tests/FluentCommand.SqlServer.Tests.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@
4646
</ItemGroup>
4747

4848
<ItemGroup>
49+
<None Update="appsettings.github.json">
50+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
51+
</None>
4952
<None Update="appsettings.appveyor.json">
5053
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
5154
</None>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"ConnectionStrings": {
3+
"Tracker": "Server=localhost;Database=TrackerGithub;User Id=sa;Password=!p@ssword;TrustServerCertificate=True;"
4+
}
5+
}

0 commit comments

Comments
 (0)