parent
679222c549
commit
31cd755121
File diff suppressed because one or more lines are too long
|
@ -24,13 +24,12 @@ if [[ -n "$UNITY_LICENSE" ]] || [[ -n "$UNITY_LICENSE_FILE" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Activate license
|
# Activate license
|
||||||
ACTIVATION_OUTPUT=$(xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
|
ACTIVATION_OUTPUT=$(unity-editor \
|
||||||
/opt/Unity/Editor/Unity \
|
-batchmode \
|
||||||
-batchmode \
|
-nographics \
|
||||||
-nographics \
|
-logFile /dev/stdout \
|
||||||
-logFile /dev/stdout \
|
-quit \
|
||||||
-quit \
|
-manualLicenseFile $FILE_PATH)
|
||||||
-manualLicenseFile $FILE_PATH)
|
|
||||||
|
|
||||||
# Store the exit code from the verify command
|
# Store the exit code from the verify command
|
||||||
UNITY_EXIT_CODE=$?
|
UNITY_EXIT_CODE=$?
|
||||||
|
@ -63,15 +62,14 @@ elif [[ -n "$UNITY_SERIAL" && -n "$UNITY_EMAIL" && -n "$UNITY_PASSWORD" ]]; then
|
||||||
echo "Requesting activation (professional license)"
|
echo "Requesting activation (professional license)"
|
||||||
|
|
||||||
# Activate license
|
# Activate license
|
||||||
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
|
unity-editor \
|
||||||
/opt/Unity/Editor/Unity \
|
-batchmode \
|
||||||
-batchmode \
|
-nographics \
|
||||||
-nographics \
|
-logFile /dev/stdout \
|
||||||
-logFile /dev/stdout \
|
-quit \
|
||||||
-quit \
|
-serial "$UNITY_SERIAL" \
|
||||||
-serial "$UNITY_SERIAL" \
|
-username "$UNITY_EMAIL" \
|
||||||
-username "$UNITY_EMAIL" \
|
-password "$UNITY_PASSWORD"
|
||||||
-password "$UNITY_PASSWORD"
|
|
||||||
|
|
||||||
# Store the exit code from the verify command
|
# Store the exit code from the verify command
|
||||||
UNITY_EXIT_CODE=$?
|
UNITY_EXIT_CODE=$?
|
||||||
|
|
|
@ -6,11 +6,10 @@ if [[ -n "$UNITY_SERIAL" ]]; then
|
||||||
#
|
#
|
||||||
# This will return the license that is currently in use.
|
# This will return the license that is currently in use.
|
||||||
#
|
#
|
||||||
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
|
unity-editor \
|
||||||
/opt/Unity/Editor/Unity \
|
-batchmode \
|
||||||
-batchmode \
|
-nographics \
|
||||||
-nographics \
|
-logFile /dev/stdout \
|
||||||
-logFile /dev/stdout \
|
-quit \
|
||||||
-quit \
|
-returnlicense
|
||||||
-returnlicense
|
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -74,15 +74,14 @@ if [ $EDIT_MODE = true ]; then
|
||||||
echo "# Testing in EditMode #"
|
echo "# Testing in EditMode #"
|
||||||
echo "###########################"
|
echo "###########################"
|
||||||
echo ""
|
echo ""
|
||||||
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
|
unity-editor \
|
||||||
/opt/Unity/Editor/Unity \
|
-batchmode \
|
||||||
-batchmode \
|
-logFile "$FULL_ARTIFACTS_PATH/editmode.log" \
|
||||||
-logFile "$FULL_ARTIFACTS_PATH/editmode.log" \
|
-projectPath "$UNITY_PROJECT_PATH" \
|
||||||
-projectPath "$UNITY_PROJECT_PATH" \
|
-runTests \
|
||||||
-runTests \
|
-testPlatform editmode \
|
||||||
-testPlatform editmode \
|
-testResults "$FULL_ARTIFACTS_PATH/editmode-results.xml" \
|
||||||
-testResults "$FULL_ARTIFACTS_PATH/editmode-results.xml" \
|
$CUSTOM_PARAMETERS
|
||||||
$CUSTOM_PARAMETERS
|
|
||||||
|
|
||||||
# Catch exit code
|
# Catch exit code
|
||||||
EDIT_MODE_EXIT_CODE=$?
|
EDIT_MODE_EXIT_CODE=$?
|
||||||
|
@ -112,15 +111,14 @@ if [ $PLAY_MODE = true ]; then
|
||||||
echo "# Testing in PlayMode #"
|
echo "# Testing in PlayMode #"
|
||||||
echo "###########################"
|
echo "###########################"
|
||||||
echo ""
|
echo ""
|
||||||
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
|
unity-editor \
|
||||||
/opt/Unity/Editor/Unity \
|
-batchmode \
|
||||||
-batchmode \
|
-logFile "$FULL_ARTIFACTS_PATH/playmode.log" \
|
||||||
-logFile "$FULL_ARTIFACTS_PATH/playmode.log" \
|
-projectPath "$UNITY_PROJECT_PATH" \
|
||||||
-projectPath "$UNITY_PROJECT_PATH" \
|
-runTests \
|
||||||
-runTests \
|
-testPlatform playmode \
|
||||||
-testPlatform playmode \
|
-testResults "$FULL_ARTIFACTS_PATH/playmode-results.xml" \
|
||||||
-testResults "$FULL_ARTIFACTS_PATH/playmode-results.xml" \
|
$CUSTOM_PARAMETERS
|
||||||
$CUSTOM_PARAMETERS
|
|
||||||
|
|
||||||
# Catch exit code
|
# Catch exit code
|
||||||
PLAY_MODE_EXIT_CODE=$?
|
PLAY_MODE_EXIT_CODE=$?
|
||||||
|
|
|
@ -6,15 +6,20 @@ describe('Docker', () => {
|
||||||
it('builds', async () => {
|
it('builds', async () => {
|
||||||
const path = Action.actionFolder;
|
const path = Action.actionFolder;
|
||||||
const dockerfile = `${path}/Dockerfile`;
|
const dockerfile = `${path}/Dockerfile`;
|
||||||
const baseImage = new ImageTag({
|
const image = new ImageTag({
|
||||||
repository: '',
|
repository: '',
|
||||||
name: 'alpine',
|
name: 'alpine',
|
||||||
version: '3',
|
version: '3',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const baseImage = {
|
||||||
|
toString: () => image.toString().slice(0, image.toString().lastIndexOf('-base-0')),
|
||||||
|
version: image.version,
|
||||||
|
};
|
||||||
|
|
||||||
const tag = await Docker.build({ path, dockerfile, baseImage }, true);
|
const tag = await Docker.build({ path, dockerfile, baseImage }, true);
|
||||||
|
|
||||||
expect(tag).toBeInstanceOf(ImageTag);
|
expect(tag).toBeInstanceOf(ImageTag);
|
||||||
expect(tag.toString()).toStrictEqual('unity-action:3');
|
expect(tag.toString()).toStrictEqual('unity-action:3-base-0');
|
||||||
}, 240000);
|
}, 240000);
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,8 +2,8 @@ import { trimStart } from 'lodash-es';
|
||||||
|
|
||||||
class ImageTag {
|
class ImageTag {
|
||||||
static createForBase({ version, customImage }) {
|
static createForBase({ version, customImage }) {
|
||||||
const repository = 'gableroux';
|
const repository = 'unityci';
|
||||||
const name = 'unity3d';
|
const name = 'editor';
|
||||||
return new this({ repository, name, version, customImage });
|
return new this({ repository, name, version, customImage });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ class ImageTag {
|
||||||
return this.customImage;
|
return this.customImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
return `${this.image}:${this.tag}`;
|
return `${this.image}:${this.tag}-base-0`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ describe('UnityImageVersion', () => {
|
||||||
it('returns the correct version', () => {
|
it('returns the correct version', () => {
|
||||||
const image = ImageTag.createForBase({ version: '2099.1.1111' });
|
const image = ImageTag.createForBase({ version: '2099.1.1111' });
|
||||||
|
|
||||||
expect(image.toString()).toStrictEqual(`gableroux/unity3d:2099.1.1111`);
|
expect(image.toString()).toStrictEqual(`unityci/editor:2099.1.1111-base-0`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns customImage if given', () => {
|
it('returns customImage if given', () => {
|
||||||
|
|
Loading…
Reference in New Issue