Skip to content

Commit 14cd209

Browse files
committed
feat: Initial Test Suite for Chat App
1 parent 6602bb7 commit 14cd209

19 files changed

+4702
-1718
lines changed

.github/workflows/test.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
push:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: '20'
19+
cache: 'npm'
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Lint
25+
run: npm run lint
26+
27+
- name: Type Check
28+
run: npx tsc --noEmit
29+
30+
- name: Start Test Mint
31+
run: |
32+
docker run -d \
33+
--name test-mint \
34+
-p 3338:3338 \
35+
-e MINT_BACKEND_BOLT11_SAT=FakeWallet \
36+
-e MINT_LISTEN_HOST=0.0.0.0 \
37+
-e MINT_LISTEN_PORT=3338 \
38+
-e MINT_PRIVATE_KEY=ci-test \
39+
cashubtc/nutshell:0.16.0 \
40+
sh -c "poetry install && poetry run mint"
41+
42+
for i in {1..30}; do
43+
if curl -f http://localhost:3338/v1/info 2>/dev/null; then
44+
echo "Mint ready"
45+
break
46+
fi
47+
sleep 1
48+
done
49+
50+
- name: Run Tests
51+
env:
52+
CI: true
53+
MINT_URL: http://localhost:3338
54+
run: npm test -- --run
55+
56+
- name: Build
57+
run: npm run build
58+
59+
- name: Cleanup
60+
if: always()
61+
run: |
62+
docker stop test-mint || true
63+
docker rm test-mint || true

0 commit comments

Comments
 (0)