Skip to content
Merged
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
162 changes: 0 additions & 162 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,83 +84,6 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}

build-android:
runs-on: [self-hosted, MAC37]
needs: Roslyn-Analyzer-dotnet

if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development' || needs.paths-filter.outputs.proxy == 'true' || needs.paths-filter.outputs.scenes == 'true' || needs.paths-filter.outputs.python == 'true'

steps:
- uses: actions/checkout@v3

- name: Build SampleGame apk
run: |
export ALTSERVER_PORT=13005
export ALTSERVER_HOST="192.168.11.35"
rm -f sampleGame.apk
git checkout -- ProjectSettings/ProjectSettings.asset
$UNITY_2021_3_HOME -batchmode -buildTarget Android -stackTraceLogType Full -projectPath $CI_PROJECT_DIR -executeMethod AltTesterTools.BuildAltTester.AndroidBuildFromCommandLine -logFile buildAndroid.log -quit
if [ ! -f sampleGame.apk ]; then echo "APK not found after build"; exit 1; fi
echo "APK size: $(du -sh sampleGame.apk)"

- uses: actions/upload-artifact@v4
if: always()
with:
name: BuildAndroidArtifact
path: |
sampleGame.apk
**/*.log

- uses: ravsamhq/notify-slack-action@2.3.0
if: ${{ always() && github.ref_name == 'development' }}
with:
status: ${{ job.status }}
notification_title: "The Job *{job}* in Workflow *{workflow}* has {status_message}"
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}@{branch}> on <{commit_url}|{commit_sha}>"
footer: "Linked Repo <{repo_url}|{repo}>"
notify_when: "failure"
mention_groups: "alttester-pipelines,!here"
mention_groups_when: "failure"
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}

build-ipa:
runs-on: [self-hosted, MAC37]
needs: Roslyn-Analyzer-dotnet
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development' || needs.paths-filter.outputs.proxy == 'true' || needs.paths-filter.outputs.scenes == 'true' || needs.paths-filter.outputs.python == 'true'
steps:
- uses: actions/checkout@v3

- name: Build sampleGame ipa
run: |
export ALTSERVER_PORT=13005
export ALTSERVER_HOST="192.168.11.35"
$UNITY_2021_3_HOME -batchmode -stackTraceLogType None -projectPath -executeMethod AltTesterTools.BuildAltTester.IosBuildFromCommandLine -logFile buildiOS.log -quit
xcodebuild -project ./sampleGame/Unity-iPhone.xcodeproj -scheme Unity-iPhone -archivePath Unity-iPhone.xcarchive archive
xcodebuild -exportArchive -archivePath ./Unity-iPhone.xcarchive -exportOptionsPlist $EXPORT_OPTIONS_LOCATION/export-options.plist -exportPath ./
osascript -e 'tell app "Xcode" to quit'

- uses: actions/upload-artifact@v4
if: always()
with:
name: BuildiOSArtifact
path: |
sampleGame.ipa
**/*.log

- uses: ravsamhq/notify-slack-action@2.3.0
if: ${{ always() && github.ref_name == 'development' }}
with:
status: ${{ job.status }}
notification_title: "The Job *{job}* in Workflow *{workflow}* has {status_message}"
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}@{branch}> on <{commit_url}|{commit_sha}>"
footer: "Linked Repo <{repo_url}|{repo}>"
notify_when: "failure"
mention_groups: "alttester-pipelines,!here"
mention_groups_when: "failure"
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}

test-CSharp-Editor:
runs-on: [self-hosted, MAC37]
needs: build-macOS
Expand Down Expand Up @@ -432,88 +355,3 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}

test-Python-Browserstack-ios-android:
runs-on: [self-hosted, MAC37]
needs:
- build-android
- build-ipa

if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development' || needs.paths-filter.outputs.proxy == 'true' || needs.paths-filter.outputs.scenes == 'true' || needs.paths-filter.outputs.python == 'true'

steps:
- uses: actions/checkout@v3

- uses: actions/download-artifact@v4
with:
name: BuildAndroidArtifact

- uses: actions/download-artifact@v4
with:
name: BuildiOSArtifact

- uses: actions/setup-python@v5
with:
python-version: "3.12.4"

- name: Install dependencies
run: |
pip install --upgrade pip setuptools wheel
pip uninstall -y AltTester-Driver
pip install -r "Bindings~/python/requirements.txt"
pip install -r "Bindings~/python/requirements-dev.txt"
pip install -e "Bindings~/python" --root "Bindings~/python" --use-pep517

- name: Run integration tests
run: |
export ALTSERVER_PORT=13005
export ALTSERVER_HOST="192.168.11.35"
export RUN_IN_BROWSERSTACK="true"
export BROWSERSTACK_USERNAME=${{ secrets.BROWSERSTACK_USERNAME }}
export BROWSERSTACK_KEY=${{ secrets.BROWSERSTACK_KEY }}
export response_android=$(curl -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_KEY" -X POST "https://api-cloud.browserstack.com/app-automate/upload" -F "file=@sampleGame.apk")
echo $response_android
export APP_URL_ANDROID=$(echo "${response_android}" | jq -r .app_url)
export response_ios=$(curl -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_KEY" -X POST "https://api-cloud.browserstack.com/app-automate/upload" -F "file=@sampleGame.ipa")
export APP_URL_IOS=$(echo "${response_ios}" | jq -r .app_url)
echo $APP_URL_ANDROID
echo $APP_URL_IOS
cd Bindings~/python/tests/integration/
pkill -f BrowserStackLocal || true
/usr/local/bin/BrowserStackLocal --key $BROWSERSTACK_KEY --force > bs_local.log &
sleep 5
pytest -s -v -n 3 ./ --alluredir=allure-report/ --reruns 3 --reruns-delay 10 --dist=loadfile -m "not iOSUnsupported and not AndroidUnsupported and not WebGLUnsupported"
pkill -f BrowserStackLocal || true

- name: Generate Allure report
if: always()
run: |
allure generate -c Bindings~/python/tests/integration/allure-report -o allure-results-html
allure-combine ./allure-results-html

- uses: actions/upload-artifact@v4
if: always()
with:
name: TestPythonAndroidInBrowserstackArtifact
path: |
**/*.log
./allure-results-html/complete.html

- name: Unset Browserstack Flag
if: always()
run: |
export RUN_IN_BROWSERSTACK="false"
unset APP_URL
unset response

- uses: ravsamhq/notify-slack-action@2.3.0
if: ${{ always() && github.ref_name == 'development' }}
with:
status: ${{ job.status }}
notification_title: "The Job *{job}* in Workflow *{workflow}* has {status_message}"
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}@{branch}> on <{commit_url}|{commit_sha}>"
footer: "Linked Repo <{repo_url}|{repo}>"
notify_when: "failure"
mention_groups: "alttester,!here"
mention_groups_when: "failure"
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ public static void OnPostProcessBuild(BuildTarget buildTarget, string buildPath)
project.AddFrameworkToProject(unityFrameworkGuid, "CFNetwork.framework", false);

// Explicitly link libNativeInputDialog.xcframework to UnityFramework so that IOS_ShowNativeInput
// is accessible at runtime. Unity links plugins to Unity-iPhone by default; symbols
// is accessible at runtime. Unity links xcframeworks to Unity-iPhone by default; symbols
// in the main executable are not exported to the embedded UnityFramework dynamic library,
// which causes a "missing symbol called" dyld crash when the symbol is invoked.
string nativeDialogLibGuid = project.FindFileGuidByProjectPath(
"Libraries/AltTester/Runtime/Plugins/iOS/libNativeInputDialog.xcframework");
// xcframeworks land under Frameworks/ (not Libraries/); path varies by install method.
string nativeDialogLibGuid = FindLibGuid(project,
"Frameworks/AltTester/Runtime/Plugins/iOS/libNativeInputDialog.xcframework",
"Frameworks/com.alttester.sdk/Runtime/Plugins/iOS/libNativeInputDialog.xcframework");
if (!string.IsNullOrEmpty(nativeDialogLibGuid))
{
project.AddFileToBuild(unityFrameworkGuid, nativeDialogLibGuid);
Expand All @@ -75,8 +77,9 @@ public static void OnPostProcessBuild(BuildTarget buildTarget, string buildPath)

// Explicitly link libAltProxyFinder.xcframework to UnityFramework so that _getProxy
// is accessible at runtime.
string proxyFinderLibGuid = project.FindFileGuidByProjectPath(
"Libraries/AltTester/Runtime/AltDriver/Proxy/Plugins/iOS/AltProxyFinder/libAltProxyFinder.xcframework");
string proxyFinderLibGuid = FindLibGuid(project,
"Frameworks/AltTester/Runtime/AltDriver/Proxy/Plugins/iOS/AltProxyFinder/libAltProxyFinder.xcframework",
"Frameworks/com.alttester.sdk/Runtime/AltDriver/Proxy/Plugins/iOS/AltProxyFinder/libAltProxyFinder.xcframework");
if (!string.IsNullOrEmpty(proxyFinderLibGuid))
{
project.AddFileToBuild(unityFrameworkGuid, proxyFinderLibGuid);
Expand Down Expand Up @@ -132,5 +135,16 @@ public static void OnPostProcessBuild(BuildTarget buildTarget, string buildPath)

Debug.Log("OnPostProcessBuild: Complete");
}

private static string FindLibGuid(PBXProject project, params string[] candidatePaths)
{
foreach (var path in candidatePaths)
{
string guid = project.FindFileGuidByProjectPath(path);
if (!string.IsNullOrEmpty(guid))
return guid;
}
return null;
}
}
#endif
2 changes: 1 addition & 1 deletion Assets/AltTester/Runtime/AltDriver/AltDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class AltDriver
private static readonly NLog.Logger logger = DriverLogManager.Instance.GetCurrentClassLogger();
private readonly IDriverCommunication communicationHandler;
private static object driverLock = new object();
public static readonly string VERSION = "2.3.2";
public static readonly string VERSION = "2.3.3";

public IDriverCommunication CommunicationHandler { get { return communicationHandler; } }

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading