-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(tests): setup tests through circleci
- Loading branch information
Showing
8 changed files
with
108 additions
and
8 deletions.
There are no files selected for viewing
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 @@ | ||
version: 2.1 | ||
executors: | ||
unity-2019: | ||
docker: | ||
- image: gableroux/unity3d:2019.3.6f1 | ||
environment: | ||
UNITY_LICENSE_CONTENT_VAR: UNITY_LICENSE_CONTENT_2019_3_6 | ||
|
||
.test-2019: &test-2019 | ||
executor: unity-2019 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Preparing Unity | ||
command: chmod +x ./.circleci/scripts/prepare_unity.sh && ./.circleci/scripts/prepare_unity.sh | ||
- run: | ||
name: Running tests | ||
command: chmod +x ./.circleci/scripts/run_unity_tests.sh && ./.circleci/scripts/run_unity_tests.sh | ||
- store_test_results: | ||
path: test-results | ||
|
||
jobs: | ||
test-editmode-2019: | ||
<<: *test-2019 | ||
environment: | ||
TEST_PLATFORM: editmode | ||
test-playmode-2019: | ||
<<: *test-2019 | ||
environment: | ||
TEST_PLATFORM: playmode | ||
|
||
workflows: | ||
version: 2 | ||
test: | ||
jobs: | ||
- test-editmode-2019: | ||
context: Unity | ||
- test-playmode-2019: | ||
context: Unity |
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,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -x | ||
|
||
mkdir -p /root/.cache/unity3d | ||
mkdir -p /root/.local/share/unity3d/Unity/ | ||
|
||
set +x | ||
|
||
echo "Extracting Unity license file..." | ||
UNITY_LICENSE_CONTENT="${!UNITY_LICENSE_CONTENT_VAR}" | ||
echo "$UNITY_LICENSE_CONTENT" | base64 --decode | tr -d '\r' > /root/.local/share/unity3d/Unity/Unity_lic.ulf | ||
|
||
echo "Building Unity project..." | ||
PROJECT_ROOT=$(pwd) | ||
PACKAGE_DEST="$PROJECT_ROOT/Packages/UnityMeshSimplifier" | ||
mkdir -p "$PACKAGE_DEST" | ||
mv Editor "$PACKAGE_DEST/Editor" | ||
mv Runtime "$PACKAGE_DEST/Runtime" | ||
|
||
mkdir "$PROJECT_ROOT/Assets" | ||
mkdir "$PROJECT_ROOT/Library" | ||
mkdir "$PROJECT_ROOT/ProjectSettings" |
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,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -x | ||
|
||
echo "Testing for $TEST_PLATFORM" | ||
|
||
PROJECT_ROOT="$(pwd)" | ||
TEST_RESULT_DIR="$PROJECT_ROOT/test-results/nunit" | ||
TEST_RESULT_FILE_NAME="$TEST_PLATFORM-results.xml" | ||
TEST_RESULT_FILE_PATH="$TEST_RESULT_DIR/$TEST_RESULT_FILE_NAME" | ||
${UNITY_EXECUTABLE:-xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' /opt/Unity/Editor/Unity} \ | ||
-projectPath "$PROJECT_ROOT" \ | ||
-runTests \ | ||
-testPlatform $TEST_PLATFORM \ | ||
-testResults "$TEST_RESULT_FILE_PATH" \ | ||
-logFile - \ | ||
-batchmode | ||
|
||
UNITY_EXIT_CODE=$? | ||
|
||
if [ $UNITY_EXIT_CODE -eq 0 ]; then | ||
echo "Run succeeded, no failures occurred"; | ||
elif [ $UNITY_EXIT_CODE -eq 2 ]; then | ||
echo "Run succeeded, some tests failed"; | ||
elif [ $UNITY_EXIT_CODE -eq 3 ]; then | ||
echo "Run failure (other failure)"; | ||
else | ||
echo "Unexpected exit code $UNITY_EXIT_CODE"; | ||
fi | ||
|
||
cat "$TEST_RESULT_FILE_PATH" | grep test-run | grep Passed | ||
exit $UNITY_TEST_EXIT_CODE |
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 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 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