Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ on:
required: false
default: true
type: boolean
use_nats:
description: 'Start a local NATS server instance'
required: false
default: false
type: boolean
use_cloud_sql:
description: 'Start Cloud SQL Proxy and connect to the DB'
required: false
Expand Down Expand Up @@ -163,6 +168,29 @@ jobs:
if: ${{ inputs.use_redis }}
run: redis-cli -h 127.0.0.1 -p 6379 -a "dummy_password_for_local_redis" PING

# --- Optional: NATS ---
- name: Start Local NATS Server
if: ${{ inputs.use_nats }}
run: |
NATS_VERSION="v2.10.18"
sudo apt-get install -y unzip
Comment thread
abdulwahab-shahzad marked this conversation as resolved.
curl -sSfL \
"https://github.com/nats-io/nats-server/releases/download/${NATS_VERSION}/nats-server-${NATS_VERSION}-linux-amd64.zip" \
-o nats-server.zip
unzip -o nats-server.zip
Comment thread
abdulwahab-shahzad marked this conversation as resolved.
chmod +x nats-server-${NATS_VERSION}-linux-amd64/nats-server
sudo mv nats-server-${NATS_VERSION}-linux-amd64/nats-server /usr/local/bin/nats-server
nohup nats-server --port 4222 --http_port 8222 > nats-server.log 2>&1 &
echo "NATS_SERVER_PID=$!" >> $GITHUB_ENV
sleep 2
echo "NATS_URL=nats://127.0.0.1:4222" >> $GITHUB_ENV

- name: Ping Local NATS
if: ${{ inputs.use_nats }}
run: |
curl --fail --silent --retry 5 --retry-delay 1 \
http://127.0.0.1:8222/healthz
Comment thread
abdulwahab-shahzad marked this conversation as resolved.
Comment thread
abdulwahab-shahzad marked this conversation as resolved.

# --- Go private module access ---
- name: Set up Go environment for private repo access
run: |
Expand Down Expand Up @@ -475,6 +503,7 @@ jobs:
run: |
[ -n "$API_PID" ] && kill $API_PID || true
[ -n "$CLOUD_SQL_PROXY_PID" ] && kill $CLOUD_SQL_PROXY_PID || true
[ -n "$NATS_SERVER_PID" ] && kill $NATS_SERVER_PID || true

- name: Check for Failed Integration Tests
run: |
Expand Down
Loading