Skip to content

Commit

Permalink
(#34) paralax: update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintAngeLs committed Sep 22, 2024
1 parent ad925cd commit 278bdf3
Show file tree
Hide file tree
Showing 17 changed files with 31 additions and 31 deletions.
10 changes: 5 additions & 5 deletions scripts/build-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ for LIBRARY in $LIBRARIES; do
echo "Processing $LIBRARY"

# Ensure we are working with valid library paths
if [ -d "src/$LIBRARY/src" ]; then
if [ -d "src/$LIBRARY/src/$LIBRARY" ]; then

# Either force build/test or run only if changes detected
if [ "$FORCE_BUILD_TEST" = true ] || [ -n "$(git diff --name-only HEAD~1 HEAD | grep "src/$LIBRARY")" ]; then
echo "Restoring dependencies for $LIBRARY"
dotnet restore "src/$LIBRARY/src"
dotnet restore "src/$LIBRARY/src/$LIBRARY"

echo "Building $LIBRARY"
dotnet build "src/$LIBRARY/src" --configuration Release --no-restore
dotnet build "src/$LIBRARY/src/$LIBRARY" --configuration Release --no-restore

if [ -d "src/$LIBRARY/tests" ]; then
if [ -d "src/$LIBRARY/tests/$LIBRARY.Tests" ]; then
echo "Running tests for $LIBRARY"
dotnet test "src/$LIBRARY/tests" --configuration Release \
dotnet test "src/$LIBRARY/tests/$LIBRARY.Tests" --configuration Release \
--collect:"XPlat Code Coverage" \
--results-directory "src/$LIBRARY/TestResults/" \
/p:CollectCoverage=true \
Expand Down
2 changes: 1 addition & 1 deletion src/Paralax.CQRS.Commands/scripts/build-and-pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
echo "Executing post-success scripts for branch $GITHUB_REF_NAME"
echo "Starting build and NuGet package creation for Paralax.CQRS.Commands..."

cd src/Paralax.CQRS.Commands/src
cd src/Paralax.CQRS.Commands/src/Paralax.CQRS.Commands

echo "Restoring NuGet packages..."
dotnet restore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

echo "Running tests and collecting coverage for Paralax.CQRS.Commands..."

cd src/Paralax.CQRS.Commands/src
cd src/Paralax.CQRS.Commands/src/Paralax.CQRS.Commands

echo "Restoring NuGet packages..."
dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion src/Paralax.CQRS.EventSourcing/scripts/build-and-pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
echo "Executing post-success scripts for branch $GITHUB_REF_NAME"
echo "Starting build and NuGet package creation for Paralax.CQRS.EventSourcing..."

cd src/Paralax.CQRS.EventSourcing/src
cd src/Paralax.CQRS.EventSourcing/src/Paralax.CQRS.EventSourcing

echo "Restoring NuGet packages..."
dotnet restore
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

echo "Running tests and collecting coverage for Paralax.Security..."
echo "Running tests and collecting coverage for Paralax.CQRS.EventSourcing..."

cd src/Paralax.Security/src
cd src/Paralax.CQRS.EventSourcing/src/Paralax.CQRS.EventSourcing

echo "Restoring NuGet packages..."
dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion src/Paralax.CQRS.Logging/scripts/build-and-pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
echo "Executing post-success scripts for branch $GITHUB_REF_NAME"
echo "Starting build and NuGet package creation for Paralax.CQRS.Logging..."

cd src/Paralax.CQRS.Logging/src
cd src/Paralax.CQRS.Logging/src/Paralax.CQRS.Logging

echo "Restoring NuGet packages..."
dotnet restore
Expand Down
4 changes: 2 additions & 2 deletions src/Paralax.CQRS.Logging/scripts/test-and-collect-coverage.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

echo "Running tests and collecting coverage for Paralax.HTTP..."
echo "Running tests and collecting coverage for Paralax.CQRS.Logging..."

cd src/Paralax.HTTP/src
cd src/Paralax.CQRS.Logging/src/Paralax.CQRS.Logging

echo "Restoring NuGet packages..."
dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion src/Paralax.CQRS.Queries/scripts/build-and-pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
echo "Executing post-success scripts for branch $GITHUB_REF_NAME"
echo "Starting build and NuGet package creation for Paralax.CQRS.Queries..."

cd src/Paralax.CQRS.Queries/src
cd src/Paralax.CQRS.Queries/src/Paralax.CQRS.Queries

echo "Restoring NuGet packages..."
dotnet restore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

echo "Running tests and collecting coverage for Paralax.CQRS.Queries..."

cd src/Paralax.CQRS.Queries/src
cd src/Paralax.CQRS.Queries/src/Paralax.CQRS.Queries

echo "Restoring NuGet packages..."
dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion src/Paralax.HTTP/scripts/build-and-pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
echo "Executing post-success scripts for branch $GITHUB_REF_NAME"
echo "Starting build and NuGet package creation for Paralax.HTTP..."

cd src/Paralax.HTTP/src
cd src/Paralax.HTTP/src/Paralax.HTTP

echo "Restoring NuGet packages..."
dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion src/Paralax.HTTP/scripts/test-and-collect-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

echo "Running tests and collecting coverage for Paralax.HTTP..."

cd src/Paralax.HTTP/src
cd src/Paralax.HTTP/src/Paralax.HTTP

echo "Restoring NuGet packages..."
dotnet restore
Expand Down
10 changes: 5 additions & 5 deletions src/Paralax.Logging/scripts/build-and-pack.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/bin/bash

echo "Executing post-success scripts for branch $GITHUB_REF_NAME"
echo "Starting build and NuGet package creation for Paralax.Security..."
echo "Starting build and NuGet package creation for Paralax.Logging..."

cd src/Paralax.Security/src
cd src/Paralax.Logging/src/Paralax.Logging

echo "Restoring NuGet packages..."
dotnet restore

PACKAGE_VERSION="1.0.$GITHUB_RUN_NUMBER"
echo "Building and packing the Paralax.Security library..."
echo "Building and packing the Paralax.Logging library..."
dotnet pack -c release /p:PackageVersion=$PACKAGE_VERSION --no-restore -o ./nupkg

PACKAGE_PATH="./nupkg/Paralax.Security.$PACKAGE_VERSION.nupkg"
PACKAGE_PATH="./nupkg/Paralax.Logging.$PACKAGE_VERSION.nupkg"

if [ -f "$PACKAGE_PATH" ]; then
echo "Checking if the package is already signed..."
Expand All @@ -25,7 +25,7 @@ if [ -f "$PACKAGE_PATH" ]; then
--timestamper http://timestamp.digicert.com
fi

echo "Uploading Paralax.Security package to NuGet..."
echo "Uploading Paralax.Logging package to NuGet..."
dotnet nuget push "$PACKAGE_PATH" -k "$NUGET_API_KEY" \
-s https://api.nuget.org/v3/index.json --skip-duplicate
echo "Package uploaded to NuGet."
Expand Down
2 changes: 1 addition & 1 deletion src/Paralax.Logging/scripts/test-and-collect-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

echo "Running tests and collecting coverage for Paralax.Logging..."

cd src/Paralax.Logging/src
cd src/Paralax.Logging/src/Paralax.Logging

echo "Restoring NuGet packages..."
dotnet restore
Expand Down
10 changes: 5 additions & 5 deletions src/Paralax.Security/scripts/build-and-pack.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/bin/bash

echo "Executing post-success scripts for branch $GITHUB_REF_NAME"
echo "Starting build and NuGet package creation for Paralax.Logging..."
echo "Starting build and NuGet package creation for Paralax.Security..."

cd src/Paralax.Logging/src
cd src/Paralax.Security/src/Paralax.Security

echo "Restoring NuGet packages..."
dotnet restore

PACKAGE_VERSION="1.0.$GITHUB_RUN_NUMBER"
echo "Building and packing the Paralax.Logging library..."
echo "Building and packing the Paralax.Security library..."
dotnet pack -c release /p:PackageVersion=$PACKAGE_VERSION --no-restore -o ./nupkg

PACKAGE_PATH="./nupkg/Paralax.Logging.$PACKAGE_VERSION.nupkg"
PACKAGE_PATH="./nupkg/Paralax.Security.$PACKAGE_VERSION.nupkg"

if [ -f "$PACKAGE_PATH" ]; then
echo "Checking if the package is already signed..."
Expand All @@ -25,7 +25,7 @@ if [ -f "$PACKAGE_PATH" ]; then
--timestamper http://timestamp.digicert.com
fi

echo "Uploading Paralax.Logging package to NuGet..."
echo "Uploading Paralax.Security package to NuGet..."
dotnet nuget push "$PACKAGE_PATH" -k "$NUGET_API_KEY" \
-s https://api.nuget.org/v3/index.json --skip-duplicate
echo "Package uploaded to NuGet."
Expand Down
2 changes: 1 addition & 1 deletion src/Paralax.Security/scripts/test-and-collect-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

echo "Running tests and collecting coverage for Paralax.Security..."

cd src/Paralax.Security/src
cd src/Paralax.Security/src/Paralax.Security

echo "Restoring NuGet packages..."
dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion src/Paralax/scripts/build-and-pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
echo "Executing post-success scripts for branch $GITHUB_REF_NAME"
echo "Starting build and NuGet package creation for Paralax framework..."

cd src/Paralax/src
cd src/Paralax/src/Paralax

echo "Restoring NuGet packages..."
dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion src/Paralax/scripts/test-and-collect-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

echo "Running tests and collecting coverage for Paralax..."

cd src/Paralax/tests
cd src/Paralax/tests/Paralax

echo "Restoring NuGet packages..."
dotnet restore
Expand Down

0 comments on commit 278bdf3

Please sign in to comment.