Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EF-165: Support for EF Core 9 - CI scripts #180

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions evergreen/evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,21 @@ functions:
shell: bash
working_dir: mongo-efcore-provider
script: |
# Get the current unique version of this checkout
if [ "${is_patch}" = "true" ]; then
CURRENT_VERSION=$(git describe)-patch-${version_id}
else
CURRENT_VERSION=latest
fi

PACKAGE_VERSION=$(bash ./evergreen/generate-version.sh)
PACKAGE_VERSION=$(bash triggered_by_git_tag=${triggered_by_git_tag} ./evergreen/generate-version.sh)

export DRIVERS_TOOLS="$(pwd)/../drivers-tools"
export DOTNET_SDK_PATH="$(pwd)/../.dotnet"

if [ "Windows_NT" = "$OS" ]; then # Magic variable in cygwin
# Python has cygwin path problems on Windows. Detect prospective mongo-orchestration home directory
export DRIVERS_TOOLS=$(cygpath -m $DRIVERS_TOOLS)
else
# non windows OSs don't have dotnet in the PATH
export PATH=$PATH:/usr/share/dotnet
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed?

fi

export MONGO_ORCHESTRATION_HOME="$DRIVERS_TOOLS/.evergreen/orchestration"
export MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin"
export PROJECT_DIRECTORY="$(pwd)"

cat <<EOT > expansion.yml
CURRENT_VERSION: "$CURRENT_VERSION"
DRIVERS_TOOLS: "$DRIVERS_TOOLS"
MONGO_ORCHESTRATION_HOME: "$MONGO_ORCHESTRATION_HOME"
MONGODB_BINARIES: "$MONGODB_BINARIES"
Expand Down Expand Up @@ -143,7 +132,7 @@ functions:
upload-test-results:
- command: attach.xunit_results
params:
file: ./mongo-efcore-provider/artifacts/test-results/TEST*.xml
file: ./mongo-efcore-provider/artifacts/test-results/**/TEST*.xml

bootstrap-mongo-orchestration:
- command: shell.exec
Expand Down Expand Up @@ -171,6 +160,19 @@ functions:
OS=${OS} \
MONGODB_URI="${MONGODB_URI}" \
CRYPT_SHARED_LIB_PATH=${CRYPT_SHARED_LIB_PATH} \
BUILD_CONFIGURATION="Debug" \
./evergreen/run-tests.sh
- command: shell.exec
type: test
params:
working_dir: mongo-efcore-provider
script: |
${PREPARE_SHELL}
DRIVER_VERSION=${DRIVER_VERSION} \
OS=${OS} \
MONGODB_URI="${MONGODB_URI}" \
CRYPT_SHARED_LIB_PATH=${CRYPT_SHARED_LIB_PATH} \
BUILD_CONFIGURATION="Debug EF9" \
./evergreen/run-tests.sh

cleanup:
Expand Down
7 changes: 6 additions & 1 deletion evergreen/generate-version.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/usr/bin/env bash
set -o errexit # Exit the script with error if any of the commands fail

PACKAGE_VERSION=$(git describe --tags)
if [ -n "$triggered_by_git_tag" ]; then
PACKAGE_VERSION=$triggered_by_git_tag
else
PACKAGE_VERSION=$(git describe --tags)
fi

PACKAGE_VERSION=$(echo $PACKAGE_VERSION | cut -c 2-)
echo "$PACKAGE_VERSION"
9 changes: 7 additions & 2 deletions evergreen/pack-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ if [ -z "$PACKAGE_VERSION" ]; then
echo Calculated PACKAGE_VERSION value: "$PACKAGE_VERSION"
fi

echo Creating nuget package...
BUILD_CONFIGURATION="Release"
if [[ "${PACKAGE_VERSION}" == "9."* ]]; then
BUILD_CONFIGURATION="Release EF9"
fi

echo Creating nuget package $PACKAGE_VERSION using $BUILD_CONFIGURATION build configuration...

dotnet clean ./MongoDB.EFCoreProvider.sln
dotnet pack ./MongoDB.EFCoreProvider.sln -o ./artifacts/nuget -c Release -p:Version="$PACKAGE_VERSION" --include-symbols -p:SymbolPackageFormat=snupkg -p:ContinuousIntegrationBuild=true
dotnet pack ./MongoDB.EFCoreProvider.sln -o ./artifacts/nuget -c "$BUILD_CONFIGURATION" -p:Version="$PACKAGE_VERSION" --include-symbols -p:SymbolPackageFormat=snupkg -p:ContinuousIntegrationBuild=true
7 changes: 4 additions & 3 deletions evergreen/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
set -o errexit # Exit the script with error if any of the commands fail

MONGODB_URI=${MONGODB_URI:=mongodb://localhost:27017/}
BUILD_CONFIGURATION=${BUILD_CONFIGURATION:=Debug}

EFCORE_PROVIDER_PROJECT_PATH="./src/MongoDB.EntityFrameworkCore/MongoDB.EntityFrameworkCore.csproj"
if [ -n "$DRIVER_VERSION" ]
Expand All @@ -12,13 +13,13 @@ then
echo "Installing the latest version of MongoDB.Driver..."
dotnet remove "$EFCORE_PROVIDER_PROJECT_PATH" package MongoDB.Driver
dotnet add "$EFCORE_PROVIDER_PROJECT_PATH" package MongoDB.Driver
elif [ -n "$DRIVER_VERSION" ]
then
else
echo "Installing the $DRIVER_VERSION version of MongoDB.Driver..."
dotnet remove "$EFCORE_PROVIDER_PROJECT_PATH" package MongoDB.Driver
dotnet add "$EFCORE_PROVIDER_PROJECT_PATH" package MongoDB.Driver -v "$DRIVER_VERSION"
fi
fi

echo "Running EF Core tests for '${BUILD_CONFIGURATION}' configuration"
dotnet clean "./MongoDB.EFCoreProvider.sln"
dotnet test "./MongoDB.EFCoreProvider.sln" -e MONGODB_URI="${MONGODB_URI}" --results-directory ./artifacts/test-results --logger "junit;LogFileName=TEST_{assembly}.xml;FailureBodyFormat=Verbose" --logger "console;verbosity=detailed"
dotnet test "./MongoDB.EFCoreProvider.sln" -e MONGODB_URI="${MONGODB_URI}" -c "${BUILD_CONFIGURATION}" --results-directory ./artifacts/test-results/${BUILD_CONFIGURATION// /} --logger "junit;LogFileName=TEST_{assembly}.xml;FailureBodyFormat=Verbose" --logger "console;verbosity=detailed"
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@
<Optimize>true</Optimize>
</PropertyGroup>

<ItemGroup>
<InternalsVisibleTo Include="MongoDB.EntityFrameworkCore.UnitTests" />
<PackageReference Remove="Microsoft.SourceLink.GitHub" />
<PackageReference Include="MongoDB.Driver" Version="3.1.0" />
</ItemGroup>

<ItemGroup Condition=" '$(Configuration)' == 'Release' Or '$(Configuration)' == 'Debug' ">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.12" />
</ItemGroup>

<ItemGroup Condition=" '$(Configuration)' == 'Release EF9' Or '$(Configuration)' == 'Debug EF9' ">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.1" />
</ItemGroup>

<ItemGroup>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why has his file changed?

<InternalsVisibleTo Include="MongoDB.EntityFrameworkCore.UnitTests" />
<PackageReference Include="MongoDB.Driver" Version="3.1.0" />
<PackageReference Remove="Microsoft.SourceLink.GitHub" />
</ItemGroup>
</Project>