-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Move logic from the Makefile to either cibuild.sh or build/scripts #21146
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env bash | ||
# Copyright (c) .NET Foundation and contributors. All rights reserved. | ||
# Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
# Source this script to ensure dotnet is installed and on the path. | ||
# If the FORCE_DOWNLOAD environment variable is set to "true", the system's dotnet install is ignored, | ||
# and dotnet is downloaded and installed locally. | ||
|
||
set -e | ||
set -u | ||
|
||
# check if `dotnet` is already on the PATH | ||
if command -v dotnet >/dev/null 2>&1 | ||
then | ||
if [[ "${FORCE_DOWNLOAD:-false}" != true ]] | ||
then | ||
exit 0 | ||
fi | ||
fi | ||
|
||
# This is a function to keep variable assignments out of the parent script (that is sourcing this file) | ||
install_dotnet () { | ||
# Download and install `dotnet` locally | ||
local DOTNET_VERSION=1.0.1 | ||
local THIS_DIR=$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
local DOTNET_PATH=${THIS_DIR}/../../Binaries/dotnet-cli | ||
|
||
if [[ ! -x "${DOTNET_PATH}/dotnet" ]] | ||
then | ||
echo "Downloading and installing .NET CLI version ${DOTNET_VERSION} to ${DOTNET_PATH}" | ||
curl https://raw.githubusercontent.com/dotnet/cli/rel/${DOTNET_VERSION}/scripts/obtain/dotnet-install.sh | \ | ||
/usr/bin/env bash -s -- --version "${DOTNET_VERSION}" --install-dir "${DOTNET_PATH}" | ||
else | ||
echo "Skipping download of .NET CLI: Already installed at ${DOTNET_PATH}" | ||
fi | ||
|
||
export PATH=${DOTNET_PATH}:${PATH} | ||
} | ||
install_dotnet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,29 @@ | ||
#!/usr/bin/env bash | ||
# Copyright (c) .NET Foundation and contributors. All rights reserved. | ||
# Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
BUILD_CONFIGURATION=$1 | ||
set -e | ||
set -u | ||
|
||
# This function will update the PATH variable to put the desired | ||
# version of Mono ahead of the system one. | ||
BUILD_CONFIGURATION=${1:-Debug} | ||
|
||
cd Binaries/$BUILD_CONFIGURATION/CoreClrTest | ||
THIS_DIR=$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
BINARIES_PATH=${THIS_DIR}/../../Binaries | ||
SRC_PATH=${THIS_DIR}/../../src | ||
TEST_DIR=${BINARIES_PATH}/${BUILD_CONFIGURATION}/CoreClrTest | ||
|
||
chmod +x ./corerun | ||
RUNTIME_ID=$(dotnet --info | awk '/RID:/{print $2;}') | ||
|
||
BUILD_ARGS="-c ${BUILD_CONFIGURATION} -r ${RUNTIME_ID} /consoleloggerparameters:Verbosity=minimal;summary /p:RoslynRuntimeIdentifier=${RUNTIME_ID}" | ||
dotnet publish ${SRC_PATH}/Test/DeployCoreClrTestRuntime -o ${TEST_DIR} ${BUILD_ARGS} | ||
|
||
cd ${TEST_DIR} | ||
|
||
mkdir -p xUnitResults | ||
|
||
./corerun ./xunit.console.netcore.exe *.UnitTests.dll -parallel all -xml xUnitResults/TestResults.xml | ||
dotnet exec ./xunit.console.netcore.exe *.UnitTests.dll -parallel all -xml xUnitResults/TestResults.xml | ||
|
||
if [ $? -ne 0 ]; then | ||
echo Unit test failed | ||
exit 1 | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jaredpar As discussed, this needs to be in this PR until the netci.groovy change (also in this PR) is merged. A follow-up PR removing this will be made at that point.