Skip to content

Brodey | CI

Brodey | CI #11

Workflow file for this run

name: Scuda CI
on:
pull_request:
branches: [main]
jobs:
tailscale_job:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: k4oU8AFYf121CNTRL
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci,tag:production
- name: Verify Tailscale IP
run: tailscale ip
- name: Run tests
run: |
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa [email protected] 'bash -s' <<'EOF'
#!/bin/bash
cd /home/brodey/scuda-latest
ls
SCUDA_PORT=14834 ./local.sh server > server_output.log 2>&1 &
server_pid=$!
sleep 5
if ! ps -p $server_pid > /dev/null; then
echo "Server failed to start (process not running)."
cat server_output.log
exit 1
fi
# Check the server output log for any errors (e.g., "socket bind failed")
if grep -q "socket bind failed" server_output.log; then
echo "Server failed to start: socket bind failed."
cat server_output.log
exit 1
fi
# change the port to our 'test' port
export SCUDA_SERVER=0.0.0.0:14834
./local.sh test && (echo "Tests passed successfully!"; exit 0) || (echo "Tests failed. Exiting..."; exit 1)
kill $server_pid
echo "server process terminated."
EOF
- name: Disconnect Tailscale
run: tailscale logout