-
Notifications
You must be signed in to change notification settings - Fork 286
162 lines (133 loc) · 3.85 KB
/
Copy pathtest.yml
File metadata and controls
162 lines (133 loc) · 3.85 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: API Smoke Test
on:
push:
paths-ignore:
- 'README.md'
- 'LICENSE'
- '.gitignore'
- 'docs/**'
- '*.md'
pull_request:
paths-ignore:
- 'README.md'
- 'LICENSE'
- '.gitignore'
- 'docs/**'
- '*.md'
workflow_dispatch:
jobs:
test-workers:
runs-on: ubuntu-latest
name: Workers API Test
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
- name: Setup pnpm
uses: pnpm/action-setup@v6
with:
version: latest
- name: Fetch Sub-Store source
env:
GITHUB_TOKEN: ${{ github.token }}
run: bash scripts/fetch-substore.sh
- name: Install dependencies
run: pnpm install
- name: Install backend dependencies
run: pnpm run install:backend
- name: Configure wrangler.toml
run: |
cp wrangler.toml.example wrangler.toml
sed -i 's/__JWT_SECRET__/test-jwt-secret-for-ci-testing-32chars/g' wrangler.toml
- name: Start dev server
run: |
pnpm run dev:workers > workers-dev.log 2>&1 &
echo "DEV_PID=$!" >> "$GITHUB_ENV"
- name: Wait for server
uses: iFaxity/wait-on-action@v1.2.1
with:
resource: http-get://127.0.0.1:3000/api/dashboard/settings/public
timeout: 120000
interval: 1000
httpTimeout: 10000
log: true
- name: Print Workers dev log on failure
if: failure()
run: |
cat workers-dev.log || true
- name: Run API tests
run: node scripts/test-dashboard.js http://localhost:3000
- name: Stop dev server
if: always()
run: |
kill "$DEV_PID" 2>/dev/null || true
pkill -f "vite" 2>/dev/null || true
test-deno:
runs-on: ubuntu-latest
name: Deno API Test
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
services:
postgres:
image: postgres:18-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Fetch Sub-Store source
env:
GITHUB_TOKEN: ${{ github.token }}
run: bash scripts/fetch-substore.sh
- name: Install dependencies
run: deno install
- name: Install backend dependencies
run: deno task install:backend
- name: Build dashboard
run: deno task build:dashboard
- name: Run database migration
run: deno task migrate
- name: Start Deno server
env:
PORT: '8000'
JWT_SECRET: test-jwt-secret-for-ci-testing-32chars
run: |
deno task dev > deno-dev.log 2>&1 &
echo "DEV_PID=$!" >> "$GITHUB_ENV"
- name: Wait for server
uses: iFaxity/wait-on-action@v1.2.1
with:
resource: http-get://127.0.0.1:8000/api/dashboard/settings/public
timeout: 120000
interval: 1000
httpTimeout: 10000
log: true
- name: Print Deno dev log on failure
if: failure()
run: |
cat deno-dev.log || true
- name: Run API tests
run: node scripts/test-dashboard.js http://localhost:8000
- name: Stop Deno server
if: always()
run: kill "$DEV_PID" 2>/dev/null || true