Skip to content

Commit 5da9780

Browse files
authored
CSHARP-5268: Configure EF Core build to be run inside of Driver's project (#1442)
1 parent 616aa49 commit 5da9780

File tree

3 files changed

+46
-13
lines changed

3 files changed

+46
-13
lines changed

evergreen/evergreen.yml

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,19 +144,20 @@ functions:
144144
${PROJECT_DIRECTORY}/${file}
145145
146146
run-external-script:
147-
- command: subprocess.exec
147+
- command: shell.exec
148148
type: test
149149
params:
150150
working_dir: mongo-csharp-driver
151-
binary: bash
151+
shell: "bash"
152152
include_expansions_in_env:
153153
- "OS"
154154
- "GIT_REPO"
155155
- "GIT_BRANCH"
156156
- "LOCAL_PATH"
157157
- "SCRIPT"
158-
args:
159-
- evergreen/run-external-script.sh
158+
script: |
159+
${PREPARE_SHELL}
160+
bash evergreen/run-external-script.sh
160161
161162
upload-mo-artifacts:
162163
- command: shell.exec
@@ -1924,6 +1925,23 @@ tasks:
19241925
DOTNET_SDK_PATH="${DOTNET_SDK_PATH}" bash ./evergreen/install-dependencies.sh
19251926
DRIVER_VERSION="${PACKAGE_VERSION}" TARGET_FRAMEWORK=netcoreapp3.1 bash ./evergreen/run-tests.sh
19261927
1928+
- name: test-efcore
1929+
commands:
1930+
- func: install-dotnet
1931+
- func: bootstrap-mongo-orchestration
1932+
- command: expansions.update
1933+
params:
1934+
updates:
1935+
- key: TEST_RESULTS_PATH
1936+
value: "./efcore/artifacts/test-results/TEST*.xml"
1937+
- func: run-external-script
1938+
vars:
1939+
GIT_REPO: "https://github.com/mongodb/mongo-efcore-provider.git"
1940+
LOCAL_PATH: ${workdir}/efcore
1941+
SCRIPT: |
1942+
${PREPARE_SHELL}
1943+
DRIVER_VERSION="${PACKAGE_VERSION}" bash ./evergreen/run-tests.sh
1944+
19271945
axes:
19281946
- id: version
19291947
display_name: MongoDB Version
@@ -2808,3 +2826,16 @@ buildvariants:
28082826
depends_on:
28092827
- name: push-packages-myget
28102828
variant: ".push-packages-myget"
2829+
2830+
- matrix_name: efcore-tests
2831+
batchtime: 720 # 12 hours
2832+
matrix_spec:
2833+
os: ["ubuntu-2004", "windows-64"]
2834+
version: ["5.0", "8.0", "latest"]
2835+
topology: "replicaset"
2836+
display_name: "Efcore tests on ${os} with MongoDB ${version}"
2837+
tasks:
2838+
- name: test-efcore
2839+
depends_on:
2840+
- name: push-packages-myget
2841+
variant: ".push-packages-myget"

evergreen/install-dotnet.sh

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
#!/usr/bin/env bash
22
set -o errexit # Exit the script with error if any of the commands fail
33

4-
DOTNET_SDK_PATH=./.dotnet
5-
mkdir -p "$DOTNET_SDK_PATH"
4+
DOTNET_SDK_PATH="${DOTNET_SDK_PATH:-./.dotnet}"
65

76
if [[ $OS =~ [Ww]indows.* ]]; then
87
echo "Downloading Windows .NET SDK installer into $DOTNET_SDK_PATH folder..."
9-
curl -Lfo "$DOTNET_SDK_PATH"/dotnet-install.ps1 https://dot.net/v1/dotnet-install.ps1
10-
echo "Installing .NET LTS SDK..."
11-
powershell.exe "$DOTNET_SDK_PATH"/dotnet-install.ps1 -Channel 8.0 -InstallDir "$DOTNET_SDK_PATH" -NoPath
8+
curl -Lfo ./dotnet-install.ps1 https://dot.net/v1/dotnet-install.ps1
9+
echo "Installing .NET 8.0 SDK..."
10+
powershell.exe ./dotnet-install.ps1 -Channel 8.0 -InstallDir "$DOTNET_SDK_PATH" -NoPath
1211
else
1312
echo "Downloading .NET SDK installer into $DOTNET_SDK_PATH folder..."
14-
curl -Lfo "$DOTNET_SDK_PATH"/dotnet-install.sh https://dot.net/v1/dotnet-install.sh
15-
echo "Installing .NET LTS SDK..."
16-
bash "$DOTNET_SDK_PATH"/dotnet-install.sh --channel 8.0 --install-dir "$DOTNET_SDK_PATH" --no-path
17-
fi
13+
curl -Lfo ./dotnet-install.sh https://dot.net/v1/dotnet-install.sh
14+
echo "Installing .NET 8.0 SDK..."
15+
bash ./dotnet-install.sh --channel 8.0 --install-dir "$DOTNET_SDK_PATH" --no-path
16+
fi

evergreen/run-external-script.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ rm -rf "${LOCAL_PATH}"
88
mkdir "${LOCAL_PATH}"
99
cd "${LOCAL_PATH}" || exit
1010

11+
echo "Cloning the remote repo..."
1112
git clone -b "${GIT_BRANCH:-main}" --single-branch "${GIT_REPO}" .
1213

1314
# add/adjust nuget.config pointing to myget so intermediate versions could be restored
@@ -29,9 +30,11 @@ EOL
2930
fi
3031

3132
# make files executable
33+
echo "Making files executable"
3234
for i in $(find "." -name \*.sh); do
3335
chmod +x $i
3436
done
3537

3638
# execute the provided script
39+
echo "Evaluating the script"
3740
eval "$SCRIPT"

0 commit comments

Comments
 (0)