Skip to content

try this

try this #25

Workflow file for this run

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:80 nginx:latest
- name: Install localtunnel
id: expose
run: npm install -g localtunnel
- name: Run localtunnel
run: lt --port 8080 > lt_output.log &
- name: Extract localtunnel URL
run: |
sleep 10
while ! grep -q "https://.*\.loca.lt" lt_output.log; do
sleep 2
done
APP_URL=$(grep -o "https://[0-9a-z-]*\.loca.lt" lt_output.log)
if [ -z "$APP_URL" ]; then
echo "Error: Could not extract localtunnel URL"
cat lt_output.log
exit 1
fi
echo "app_url=$APP_URL" >> $GITHUB_OUTPUT
echo "Extracted URL: $APP_URL"
- name: Debug localtunnel logs
run: cat lt_output.log
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"