-
Notifications
You must be signed in to change notification settings - Fork 127
84 lines (74 loc) · 2.48 KB
/
test_self_hosted_backend.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Test Self-Hosted Backend
on:
workflow_call:
inputs:
image_digest_x64:
description: "x64 image digest to test"
type: string
required: true
image_digest_arm64:
description: "arm64 image digest to test"
type: string
required: true
jobs:
test_self_hosted_backend:
name: Test self-hosted backend
runs-on: ubuntu-latest
timeout-minutes: 10
services:
backend:
image: ghcr.io/get-convex/convex-backend@${{ inputs.image_digest_x64 }}
env:
ACTIONS_USER_TIMEOUT_SECS: "20"
CONVEX_CLOUD_ORIGIN: "http://127.0.0.1:3210"
CONVEX_SITE_ORIGIN: "http://127.0.0.1:3211"
ports:
- "3210:3210" # Backend API
- "3211:3211" # Site proxy
options: >-
--health-cmd "curl -f http://localhost:3210/version"
--health-interval 10s
--health-timeout 5s
--health-retries 5
--health-start-period 10s
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache pnpm artifacts
uses: runs-on/cache@v4
env:
AWS_REGION: ${{ vars.AWS_REGION }}
RUNS_ON_S3_BUCKET_CACHE: ${{ vars.RUNS_ON_S3_BUCKET_CACHE }}
with:
path: |
npm-packages/common/temp/build-cache
npm-packages/common/temp/pnpm-store
key: pnpm-cache-${{
hashFiles('npm-packages/common/config/rush/pnpm-lock.yaml') }}-2
restore-keys: pnpm-cache-
- name: Node setup
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: NPM install globals
run: npm ci --prefix scripts
- name: Install Just
uses: extractions/setup-just@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build NPM Packages
run: |
just rush install
just rush build -t .
working-directory: npm-packages/js-integration-tests
- name: Run integration tests
working-directory: npm-packages/js-integration-tests
env:
SKIP_INSTANCE_SECRET_TESTS: 1
DEPLOYMENT_URL: http://127.0.0.1:3210
SITE_URL: http://127.0.0.1:3211
run: |
ADMIN_KEY=$(docker exec ${{ job.services.backend.id }} ./generate_admin_key.sh)
echo "Pushing functions... "
npx convex deploy --url http://127.0.0.1:3210 --admin-key $ADMIN_KEY
ADMIN_KEY=$ADMIN_KEY npm run test-integration