Update ngrok configuration to use port 8080 instead of port 80 in tes… #36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: TestDriver.ai | |
on: | |
push: | |
branches: ["main", "windows-testdriver"] | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
start_container: | |
runs-on: ubuntu-latest | |
outputs: | |
app_url: ${{ steps.expose.outputs.app_url }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Run Nginx Container | |
run: | | |
docker run -d -p 8080:8080 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 | |
- name: Start ngrok and expose | |
id: expose | |
run: | | |
ngrok config add-authtoken ${{ secrets.NGROK_AUTH_TOKEN }} | |
ngrok http 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') | |
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" |