From eee4ea1d6ca1eacb09aa30442acfcd31e7726f4f Mon Sep 17 00:00:00 2001 From: Kieran Date: Thu, 22 Feb 2024 18:08:59 +1100 Subject: [PATCH] add vnc for debugging --- .github/workflows/sync_end_to_end.yml | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.github/workflows/sync_end_to_end.yml b/.github/workflows/sync_end_to_end.yml index e411cd8418..755d6d4298 100644 --- a/.github/workflows/sync_end_to_end.yml +++ b/.github/workflows/sync_end_to_end.yml @@ -84,6 +84,41 @@ jobs: | tee xcodebuild.log \ | xcbeautify --report junit --report-path . --junit-report-filename ui-tests.xml \ + - name: Setup vnc + env: + NGROK_AUTH_TOKEN: ${{ secrets.NGROK_TOKEN }} + VNC_USER_PASSWORD: ${{ secrets.VNC_USER_PASSWORD }} + VNC_PASSWORD: ${{ secrets.VNC_PASSWORD }} + run: | + sudo mdutil -i off -a + sudo dscl . -create /Users/vncuser + sudo dscl . -create /Users/vncuser UserShell /bin/bash + sudo dscl . -create /Users/vncuser RealName "VNC User" + sudo dscl . -create /Users/vncuser UniqueID 1001 + sudo dscl . -create /Users/vncuser PrimaryGroupID 80 + sudo dscl . -create /Users/vncuser NFSHomeDirectory /Users/vncuser + sudo dscl . -passwd /Users/vncuser ${{ env.VNC_USER_PASSWORD }} + sudo dscl . -passwd /Users/vncuser ${{ env.VNC_USER_PASSWORD }} + sudo createhomedir -c -u vncuser > /dev/null + + sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -allowAccessFor -allUsers -privs -all + sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -clientopts -setvnclegacy -vnclegacy yes + + echo ${{ env.VNC_PASSWORD }} | perl -we 'BEGIN { @k = unpack "C*", pack "H*", "1734516E8BA8C5E2FF1C39567390ADCA"}; $_ = <>; chomp; s/^(.{8}).*/$1/; @p = unpack "C*", $_; foreach (@k) { printf "%02X", $_ ^ (shift @p || 0) }; print "\n"' | sudo tee /Library/Preferences/com.apple.VNCSettings.txt + + sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent -console + sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate + + brew install --cask ngrok + ngrok authtoken ${{ env.NGROK_AUTH_TOKEN }} + ngrok tcp 5900 & + + - name: NGROK URL + run: curl --silent http://127.0.0.1:4040/api/tunnels | jq '.tunnels[0].public_url' + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + # - name: Create Asana task when workflow failed # if: ${{ failure() }} # run: |