Skip to content

Test on Vercel Edge Functions in CI #127

Test on Vercel Edge Functions in CI

Test on Vercel Edge Functions in CI #127

Workflow file for this run

name: "CI"
on:
push:
branches: ["main"]
pull_request:
jobs:
"node-test":
name: "Build and test on Node.js"
runs-on: ubuntu-latest
steps:
- name: "Checkout this repo"
uses: actions/checkout@v3
- name: "Setup Node.js"
uses: actions/setup-node@v3
with:
node-version: "16.x"
cache: "npm"
- name: "Install npm dependencies"
run: "npm ci"
- name: "Checkout hrana-test-server"
uses: actions/checkout@v3
with:
repository: "libsql/hrana-test-server"
path: "hrana-test-server"
- name: "Setup Python"
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
- name: "Install pip dependencies"
run: "pip install -r hrana-test-server/requirements.txt"
- name: "Build"
run: "npm run build"
- name: "Test Hrana 1 over WebSockets"
run: "python hrana-test-server/server_v1.py npm test"
env:
"URL": "ws://localhost:8080"
"SERVER": "test_v1"
- name: "Test Hrana 2 over WebSockets"
run: "python hrana-test-server/server_v2.py npm test"
env:
"URL": "ws://localhost:8080"
"SERVER": "test_v2"
- name: "Test Hrana 2 over HTTP"
run: "python hrana-test-server/server_v2.py npm test"
env:
"URL": "http://localhost:8080"
"SERVER": "test_v2"
- name: "Test local file"
run: "npm test"
env:
"URL": "file:///tmp/test.db"
- name: "Test example"
run: "node examples/example.js"
env:
"URL": "file:///tmp/example.db"
# "workers-test":
# name: "Build and test with Cloudflare Workers"
# runs-on: ubuntu-latest
# env:
# "CLOUDFLARE_API_TOKEN": "${{ secrets.CLOUDFLARE_API_TOKEN }}"
# "CLOUDFLARE_ACCOUNT_ID": "${{ secrets.CLOUDFLARE_ACCOUNT_ID }}"
# "NGROK_AUTHTOKEN": "${{ secrets.NGROK_AUTHTOKEN }}"
# steps:
# - name: "Checkout this repo"
# uses: actions/checkout@v3
# - name: "Setup Node.js"
# uses: actions/setup-node@v3
# with:
# node-version: "19.x"
# cache: "npm"
# - name: "Install npm dependencies"
# run: "npm ci"
# - name: "Checkout hrana-test-server"
# uses: actions/checkout@v3
# with:
# repository: "libsql/hrana-test-server"
# path: "hrana-test-server"
# - name: "Setup Python"
# uses: actions/setup-python@v4
# with:
# python-version: "3.10"
# cache: "pip"
# - name: "Install pip dependencies"
# run: "pip install -r hrana-test-server/requirements.txt"
# - name: "Build"
# run: "npm run build"
# - name: "Install npm dependencies of the Workers test"
# run: "cd smoke_test/workers && npm link ../.."
# - name: "Local test with Hrana 1 over WebSockets"
# run: "cd smoke_test/workers && python ../../hrana-test-server/server_v1.py node test.js"
# env:
# "LOCAL": "1"
# "URL": "ws://localhost:8080"
# - name: "Local test with Hrana 2 over WebSockets"
# run: "cd smoke_test/workers && python ../../hrana-test-server/server_v2.py node test.js"
# env:
# "LOCAL": "1"
# "URL": "ws://localhost:8080"
# - name: "Local test with Hrana 2 over HTTP"
# run: "cd smoke_test/workers && python ../../hrana-test-server/server_v2.py node test.js"
# env:
# "LOCAL": "1"
# "URL": "http://localhost:8080"
# - name: "Non-local test with Hrana 1 over WebSockets"
# run: "cd smoke_test/workers && python ../../hrana-test-server/server_v1.py node test.js"
# env:
# "LOCAL": "0"
# "URL": "ws://localhost:8080"
# - name: "Non-local test with Hrana 2 over WebSockets"
# run: "cd smoke_test/workers && python ../../hrana-test-server/server_v2.py node test.js"
# env:
# "LOCAL": "0"
# "URL": "ws://localhost:8080"
# - name: "Non-local test with Hrana 2 over HTTP"
# run: "cd smoke_test/workers && python ../../hrana-test-server/server_v2.py node test.js"
# env:
# "LOCAL": "0"
# "URL": "http://localhost:8080"
"vercel-test":
name: "Build and test with Vercel Edge Functions"
runs-on: ubuntu-latest
env:
"VERCEL_TOKEN": "${{ secrets.VERCEL_TOKEN }}"
"VERCEL_PROJECT_NAME": "smoke-test"
"NGROK_AUTHTOKEN": "${{ secrets.NGROK_AUTHTOKEN }}"
steps:
- name: "Checkout this repo"
uses: actions/checkout@v3
- name: "Setup Node.js"
uses: actions/setup-node@v3
with:
node-version: "19.x"
cache: "npm"
- name: "Install npm dependencies"
run: "npm ci"
- name: "Checkout hrana-test-server"
uses: actions/checkout@v3
with:
repository: "libsql/hrana-test-server"
path: "hrana-test-server"
- name: "Setup Python"
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
- name: "Install pip dependencies"
run: "pip install -r hrana-test-server/requirements.txt"
- name: "Build"
run: "npm run build"
- name: "Install npm dependencies of the Vercel test"
run: "cd smoke_test/vercel && npm install"
- name: "Test with Hrana 1 over WebSockets"
run: "cd smoke_test/vercel && python ../../hrana-test-server/server_v1.py node test.js"
env:
"URL": "ws://localhost:8080"
- name: "Test with Hrana 2 over WebSockets"
run: "cd smoke_test/vercel && python ../../hrana-test-server/server_v2.py node test.js"
env:
"URL": "ws://localhost:8080"
- name: "Test with Hrana 2 over HTTP"
run: "cd smoke_test/vercel && python ../../hrana-test-server/server_v2.py node test.js"
env:
"URL": "http://localhost:8080"