Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit 2f800f7

Browse files
added tests to build script
1 parent ef34ea7 commit 2f800f7

3 files changed

Lines changed: 29 additions & 5 deletions

File tree

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ COPY ./src/*/*.csproj ./src/Directory.Build.props ./
3838

3939
RUN for file in $(ls *.csproj); do mkdir -p ./${file%.*}/ && mv $file ./${file%.*}/; done
4040

41+
WORKDIR /app/tests
42+
43+
COPY ./tests/*/*.csproj ./
44+
45+
RUN for file in $(ls *.csproj); do mkdir -p ./${file%.*}/ && mv $file ./${file%.*}/; done
46+
4147
WORKDIR /app
4248

4349
COPY ./NuGet.Config ./
@@ -50,6 +56,10 @@ COPY ./src .
5056

5157
COPY --from=build-javascript /app/node_modules/${CLIENT_PACKAGE}/build /app/src/SqlStreamStore.Server/Browser/build
5258

59+
WORKDIR /app/tests
60+
61+
COPY ./tests .
62+
5363
WORKDIR /app/build
5464

5565
COPY ./build/build.csproj .
@@ -58,6 +68,10 @@ RUN dotnet restore
5868

5969
COPY ./build .
6070

71+
WORKDIR /app/src
72+
73+
COPY ./src .
74+
6175
WORKDIR /app
6276

6377
RUN dotnet run --project build/build.csproj -- --runtime=${RUNTIME} --library-version=${LIBRARY_VERSION}

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e
44

55
CONTAINER_RUNTIME=${CONTAINER_RUNTIME:-alpine3.9}
6-
LIBRARY_VERSION=${LIBRARY_VERSION:-1.2.0-beta.3.12}
6+
LIBRARY_VERSION=${LIBRARY_VERSION:-1.2.0-beta.3.19}
77
CLIENT_VERSION=${CLIENT_VERSION:-0.9.2}
88

99
LOCAL_IMAGE="sql-stream-store-server"

build/Program.cs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ static class Program
1212

1313
public static void Main(string[] args)
1414
{
15-
const string clean = nameof(Clean);
16-
const string build = nameof(Build);
17-
const string publish = nameof(Publish);
15+
const string clean = nameof(clean);
16+
const string build = nameof(build);
17+
const string test = nameof(test);
18+
const string publish = nameof(publish);
1819

1920
var runtime = "alpine-x64";
2021
var libraryVersion = "1.2.0-beta.*";
@@ -43,8 +44,13 @@ public static void Main(string[] args)
4344
Build(libraryVersion));
4445

4546
Target(
46-
publish,
47+
test,
4748
DependsOn(build),
49+
Test);
50+
51+
Target(
52+
publish,
53+
DependsOn(test),
4854
Publish(runtime, libraryVersion));
4955

5056
Target("default", DependsOn(publish));
@@ -69,6 +75,10 @@ private static Action Build(string libraryVersion) => () => Run(
6975
"dotnet",
7076
$"build SqlStreamStore.Server.sln --configuration=Release /p:LibraryVersion={libraryVersion}");
7177

78+
private static readonly Action Test = () => Run(
79+
"dotnet",
80+
$"test --configuration=Release --no-build");
81+
7282
private static Action Publish(string runtime, string libraryVersion) => () => Run(
7383
"dotnet",
7484
$"publish --configuration=Release --output=../../{PublishDir} --runtime={runtime} /p:ShowLinkerSizeComparison=true /p:LibraryVersion={libraryVersion} src/SqlStreamStore.Server");

0 commit comments

Comments
 (0)