Fix failing Logs tests. #3
This file contains hidden or 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: Run Tests | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| workflow_dispatch: | |
| env: | |
| QSTASH_URL: http://127.0.0.1:8080 | |
| QSTASH_TOKEN: eyJVc2VySUQiOiJkZWZhdWx0VXNlciIsIlBhc3N3b3JkIjoiZGVmYXVsdFBhc3N3b3JkIn0= | |
| APPLICATION_URL: http://localhost:3000 | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.23' | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Install QStash CLI | |
| run: npm install -g @upstash/qstash-cli | |
| - name: Start QStash development server | |
| run: | | |
| npx @upstash/qstash-cli dev & | |
| echo "Waiting for QStash development server to start..." | |
| for i in {1..600}; do | |
| echo "Pinging QStash server..." | |
| status=$(curl -s -o /dev/null -w "%{http_code}" -X GET "${QSTASH_URL}/v2/liveness" -H "Authorization: Bearer ${QSTASH_TOKEN}" || echo "NAN") | |
| echo "HTTP status: $status" | |
| if [ "$status" = "200" ]; then | |
| echo "QStash development server is ready!" | |
| break | |
| fi | |
| if [ $i -eq 600 ]; then | |
| echo "Error: Failed to get HTTP 200 response from QStash server within 10 minutes" | |
| exit 1 | |
| fi | |
| sleep 1 | |
| done | |
| - name: Install Next.js dependencies | |
| working-directory: ./test_workflow | |
| run: npm install | |
| - name: Start Next.js application for test workflows | |
| working-directory: ./test_workflow | |
| run: | | |
| npm run dev -- -p 3000 & | |
| echo "Waiting for Next.js server to start..." | |
| for i in {1..120}; do | |
| echo "Attempt $i: Pinging Next.js server..." | |
| status=$(curl -s -o /dev/null -w "%{http_code}" -X GET "${APPLICATION_URL}" || echo "NAN") | |
| echo "HTTP status: $status" | |
| if [ "$status" = "200" ]; then | |
| echo "Next.js server is ready!" | |
| break | |
| fi | |
| if [ $i -eq 120 ]; then | |
| echo "Error: Failed to get HTTP 200 response from Next.js server within 2 minutes" | |
| exit 1 | |
| fi | |
| sleep 1 | |
| done | |
| - name: Build | |
| run: make | |
| - name: Run Go tests | |
| run: make test |