Skip to content
Merged
Show file tree
Hide file tree
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
43 changes: 23 additions & 20 deletions .github/workflows/_test-bun-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,13 @@ name: Test Bun Template
on:
workflow_call:

env:
RESTATE_IDENTITY_KEYS: "publickeyv1_8yHkhqyKeDaLytykZnKqrEQK27wF5A569edCqc5Vq2VH"

jobs:
test:
runs-on: ubuntu-latest

services:
restate:
image: docker.restate.dev/restatedev/restate:latest
ports:
- 8080:8080
- 9070:9070
env:
DO_NOT_TRACK: true
options: >-
--health-cmd "curl -f http://localhost:9070/health || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 5
--add-host=host.docker.internal:host-gateway

steps:
- uses: actions/checkout@v4

Expand All @@ -45,6 +33,20 @@ jobs:
- name: Build packages
run: pnpm build

- name: Start Restate
run: |
docker run -d --name restate \
-p 8080:8080 -p 9070:9070 \
-v ${{ github.workspace }}/test/fixtures/request-signing:/etc/restate-signing:ro \
-e RESTATE_REQUEST_IDENTITY_PRIVATE_KEY_PEM_FILE=/etc/restate-signing/private.pem \
-e DO_NOT_TRACK=true \
--add-host=host.docker.internal:host-gateway \
docker.restate.dev/restatedev/restate:latest

# Wait for Restate to be healthy
timeout 60 bash -c 'until curl -sf http://localhost:9070/health; do sleep 2; done'
echo "Restate is ready!"

- name: Start Bun service
working-directory: packages/examples/bun
run: |
Expand All @@ -60,7 +62,7 @@ jobs:

- name: Test Bun template
run: |
echo "Testing Greeter service..."
echo "Testing Greeter service (with request signing)..."
RESPONSE=$(curl -s localhost:8080/Greeter/greet --json '{"name": "Bun"}')
echo "Response: $RESPONSE"

Expand All @@ -76,7 +78,7 @@ jobs:
if: failure()
run: |
echo "=== Restate logs ==="
docker logs $(docker ps -q --filter ancestor=docker.restate.dev/restatedev/restate:latest)
docker logs restate

echo "=== Service logs ==="
if [ -f packages/examples/bun/service.pid ]; then
Expand All @@ -85,8 +87,9 @@ jobs:

- name: Cleanup
if: always()
working-directory: packages/examples/bun
run: |
if [ -f service.pid ]; then
kill $(cat service.pid) || true
if [ -f packages/examples/bun/service.pid ]; then
kill $(cat packages/examples/bun/service.pid) || true
fi
docker stop restate || true
docker rm restate || true
48 changes: 28 additions & 20 deletions .github/workflows/_test-cloudflare-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,13 @@ name: Test Cloudflare Worker Template
on:
workflow_call:

env:
RESTATE_IDENTITY_KEYS: "publickeyv1_8yHkhqyKeDaLytykZnKqrEQK27wF5A569edCqc5Vq2VH"

jobs:
test:
runs-on: ubuntu-latest

services:
restate:
image: docker.restate.dev/restatedev/restate:latest
ports:
- 8080:8080
- 9070:9070
env:
DO_NOT_TRACK: true
options: >-
--health-cmd "curl -f http://localhost:9070/health || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 5
--add-host=host.docker.internal:host-gateway

steps:
- uses: actions/checkout@v4

Expand All @@ -40,6 +28,25 @@ jobs:
- name: Build packages
run: pnpm build

- name: Start Restate
run: |
docker run -d --name restate \
-p 8080:8080 -p 9070:9070 \
-v ${{ github.workspace }}/test/fixtures/request-signing:/etc/restate-signing:ro \
-e RESTATE_REQUEST_IDENTITY_PRIVATE_KEY_PEM_FILE=/etc/restate-signing/private.pem \
-e DO_NOT_TRACK=true \
--add-host=host.docker.internal:host-gateway \
docker.restate.dev/restatedev/restate:latest

# Wait for Restate to be healthy
timeout 60 bash -c 'until curl -sf http://localhost:9070/health; do sleep 2; done'
echo "Restate is ready!"

- name: Create .dev.vars for Cloudflare Worker
working-directory: packages/examples/cloudflare
run: |
echo "RESTATE_IDENTITY_KEYS=${{ env.RESTATE_IDENTITY_KEYS }}" > .dev.vars

- name: Start Cloudflare Worker (wrangler dev)
working-directory: packages/examples/cloudflare
run: |
Expand All @@ -55,7 +62,7 @@ jobs:

- name: Test Cloudflare Worker template
run: |
echo "Testing Greeter service..."
echo "Testing Greeter service (with request signing)..."
RESPONSE=$(curl -s localhost:8080/Greeter/greet --json '{"name": "Cloudflare"}')
echo "Response: $RESPONSE"

Expand All @@ -71,7 +78,7 @@ jobs:
if: failure()
run: |
echo "=== Restate logs ==="
docker logs $(docker ps -q --filter ancestor=docker.restate.dev/restatedev/restate:latest)
docker logs restate

echo "=== Wrangler logs ==="
if [ -f packages/examples/cloudflare/service.pid ]; then
Expand All @@ -80,8 +87,9 @@ jobs:

- name: Cleanup
if: always()
working-directory: packages/examples/cloudflare
run: |
if [ -f service.pid ]; then
kill $(cat service.pid) || true
if [ -f packages/examples/cloudflare/service.pid ]; then
kill $(cat packages/examples/cloudflare/service.pid) || true
fi
docker stop restate || true
docker rm restate || true
43 changes: 23 additions & 20 deletions .github/workflows/_test-deno-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,13 @@ name: Test Deno Template
on:
workflow_call:

env:
RESTATE_IDENTITY_KEYS: "publickeyv1_8yHkhqyKeDaLytykZnKqrEQK27wF5A569edCqc5Vq2VH"

jobs:
test:
runs-on: ubuntu-latest

services:
restate:
image: docker.restate.dev/restatedev/restate:latest
ports:
- 8080:8080
- 9070:9070
env:
DO_NOT_TRACK: true
options: >-
--health-cmd "curl -f http://localhost:9070/health || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 5
--add-host=host.docker.internal:host-gateway

steps:
- uses: actions/checkout@v4

Expand All @@ -45,6 +33,20 @@ jobs:
- name: Build packages
run: pnpm build

- name: Start Restate
run: |
docker run -d --name restate \
-p 8080:8080 -p 9070:9070 \
-v ${{ github.workspace }}/test/fixtures/request-signing:/etc/restate-signing:ro \
-e RESTATE_REQUEST_IDENTITY_PRIVATE_KEY_PEM_FILE=/etc/restate-signing/private.pem \
-e DO_NOT_TRACK=true \
--add-host=host.docker.internal:host-gateway \
docker.restate.dev/restatedev/restate:latest

# Wait for Restate to be healthy
timeout 60 bash -c 'until curl -sf http://localhost:9070/health; do sleep 2; done'
echo "Restate is ready!"

- name: Install Deno dependencies
working-directory: packages/examples/deno
run: deno install
Expand All @@ -64,7 +66,7 @@ jobs:

- name: Test Deno template
run: |
echo "Testing Greeter service..."
echo "Testing Greeter service (with request signing)..."
RESPONSE=$(curl -s localhost:8080/Greeter/greet --json '{"name": "Deno"}')
echo "Response: $RESPONSE"

Expand All @@ -80,7 +82,7 @@ jobs:
if: failure()
run: |
echo "=== Restate logs ==="
docker logs $(docker ps -q --filter ancestor=docker.restate.dev/restatedev/restate:latest)
docker logs restate

echo "=== Service logs ==="
if [ -f packages/examples/deno/service.pid ]; then
Expand All @@ -89,8 +91,9 @@ jobs:

- name: Cleanup
if: always()
working-directory: packages/examples/deno
run: |
if [ -f service.pid ]; then
kill $(cat service.pid) || true
if [ -f packages/examples/deno/service.pid ]; then
kill $(cat packages/examples/deno/service.pid) || true
fi
docker stop restate || true
docker rm restate || true
43 changes: 23 additions & 20 deletions .github/workflows/_test-node-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,13 @@ name: Test Node Template
on:
workflow_call:

env:
RESTATE_IDENTITY_KEYS: "publickeyv1_8yHkhqyKeDaLytykZnKqrEQK27wF5A569edCqc5Vq2VH"

jobs:
test:
runs-on: ubuntu-latest

services:
restate:
image: docker.restate.dev/restatedev/restate:latest
ports:
- 8080:8080
- 9070:9070
env:
DO_NOT_TRACK: true
options: >-
--health-cmd "curl -f http://localhost:9070/health || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 5
--add-host=host.docker.internal:host-gateway

steps:
- uses: actions/checkout@v4

Expand All @@ -40,6 +28,20 @@ jobs:
- name: Build packages
run: pnpm build

- name: Start Restate
run: |
docker run -d --name restate \
-p 8080:8080 -p 9070:9070 \
-v ${{ github.workspace }}/test/fixtures/request-signing:/etc/restate-signing:ro \
-e RESTATE_REQUEST_IDENTITY_PRIVATE_KEY_PEM_FILE=/etc/restate-signing/private.pem \
-e DO_NOT_TRACK=true \
--add-host=host.docker.internal:host-gateway \
docker.restate.dev/restatedev/restate:latest

# Wait for Restate to be healthy
timeout 60 bash -c 'until curl -sf http://localhost:9070/health; do sleep 2; done'
echo "Restate is ready!"

- name: Start Node service
working-directory: packages/examples/node
run: |
Expand All @@ -55,7 +57,7 @@ jobs:

- name: Test Node template
run: |
echo "Testing Greeter service..."
echo "Testing Greeter service (with request signing)..."
RESPONSE=$(curl -s localhost:8080/Greeter/greet --json '{"name": "Node"}')
echo "Response: $RESPONSE"

Expand All @@ -71,7 +73,7 @@ jobs:
if: failure()
run: |
echo "=== Restate logs ==="
docker logs $(docker ps -q --filter ancestor=docker.restate.dev/restatedev/restate:latest)
docker logs restate

echo "=== Service logs ==="
if [ -f packages/examples/node/service.pid ]; then
Expand All @@ -80,8 +82,9 @@ jobs:

- name: Cleanup
if: always()
working-directory: packages/examples/node
run: |
if [ -f service.pid ]; then
kill $(cat service.pid) || true
if [ -f packages/examples/node/service.pid ]; then
kill $(cat packages/examples/node/service.pid) || true
fi
docker stop restate || true
docker rm restate || true
Loading
Loading