Skip to content

Commit

Permalink
add vnc for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
kshann committed Feb 22, 2024
1 parent da54fdf commit eee4ea1
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/sync_end_to_end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down

0 comments on commit eee4ea1

Please sign in to comment.