Skip to content

Commit

Permalink
try this
Browse files Browse the repository at this point in the history
  • Loading branch information
chottuthejimmy committed Dec 16, 2024
1 parent 600a200 commit 2918f4c
Showing 1 changed file with 11 additions and 47 deletions.
58 changes: 11 additions & 47 deletions .github/workflows/testdriver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,61 +14,25 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Run Nginx Container
run: |
docker run -d -p 8080:8080 nginx:latest
docker run -d -p 8080:80 nginx:latest
- name: Install ngrok
run: |
curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null
echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list
sudo apt update && sudo apt install ngrok
wget https://bin.equinox.io/c/111111/ngrok-stable-linux-amd64.zip
unzip ngrok-stable-linux-amd64.zip
sudo mv ngrok /usr/local/bin
- name: Start ngrok and expose
id: expose
run: |
ngrok config add-authtoken ${{ secrets.NGROK_AUTH_TOKEN }}
ngrok config add-authtoken ${{ secrets.NGROK_AUTH_TOKEN }} || { echo "Ngrok auth token failed"; exit 1; }
ngrok http http://localhost:8080 > ngrok.log &
sleep 10
curl --silent http://localhost:4040/api/tunnels > tunnels.json
APP_URL=$(cat tunnels.json | jq -r '.tunnels[0].public_url')
curl --silent http://localhost:4040/api/tunnels > tunnels.json || { echo "Failed to fetch tunnels"; exit 1; }
APP_URL=$(jq -r '.tunnels[0].public_url' tunnels.json)
echo "Generated URL: $APP_URL"
echo "app_url=$APP_URL" >> $GITHUB_OUTPUT
curl $APP_URL/health-check
- name: Debug ngrok logs
run: cat ngrok.log
# - name: Test Against URL
# run: |
# # Since we are still in the same job, ngrok is still running
# if [ -z "$APP_URL" ]; then
# echo "Error: URL is empty"
# exit 1
# fi
# curl "$APP_URL/health-check"

# test_url:
# name: "Test URL"
# runs-on: ubuntu-latest
# needs: [start_container]
# steps:
# - run: |
# echo "Received URL: ${{needs.start_container.outputs.app_url}}"
# if [ -z "${{needs.start_container.outputs.app_url}}" ]; then
# echo "Error: URL is empty"
# exit 1
# fi
# curl "${{needs.start_container.outputs.app_url}}/health-check"
# test:
# name: "TestDriver"
# runs-on: ubuntu-latest
# needs: [start_container]
# steps:
# - uses: testdriverai/action@main
# with:
# key: ${{secrets.TESTDRIVER_API_KEY}}
# prompt: |
# 1. check if the app is running.
# prerun: |
# Start-Process "C:/Program Files/Google/Chrome/Application/chrome.exe" -ArgumentList "--start-maximized", "--load-extension=$(pwd)/node_modules/dashcam-chrome/build", "${{ needs.start_container.outputs.app_url }}"
# exit
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# FORCE_COLOR: "3"
curl $APP_URL/health-check || { echo "Health check failed"; exit 1; }

0 comments on commit 2918f4c

Please sign in to comment.