-
Notifications
You must be signed in to change notification settings - Fork 135
95 lines (90 loc) · 2.81 KB
/
Copy pathci-testing.yml
File metadata and controls
95 lines (90 loc) · 2.81 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
name: CI Testing
on:
pull_request:
branches: [main]
permissions:
contents: read
jobs:
e2e:
name: E2E Tests (Playwright)
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: Install frontend deps
working-directory: frontend
run: npm ci --ignore-scripts
- name: Install Playwright
working-directory: frontend
run: npx playwright install --with-deps chromium
- name: Start backend
working-directory: backend
run: |
mkdir -p data
npm ci
npm start &
for i in $(seq 1 30); do
curl -s http://localhost:4000/health && break
[ "$i" -eq 30 ] && echo "Backend failed to start" && exit 1
sleep 1
done
env:
PORT: 4000
NODE_ENV: test
DB_PROVIDER: sqlite
STELLAR_NETWORK: testnet
HORIZON_URL: https://horizon-testnet.stellar.org
JWT_SECRET: test-secret-for-e2e
ALLOWED_ORIGINS: "*"
ANTHROPIC_API_KEY: test-key-for-ci
- name: Run E2E
working-directory: frontend
run: npm run test:e2e
env:
NEXT_PUBLIC_API_URL: http://localhost:4000
NEXT_OUTPUT: export
NEXT_PUBLIC_CONTRACT_ID: CCW67TSZV3SSS2HXMBQ52NVF3FB25GQ2G6E3BGLZ52B7W7TKG4E7SML2
- name: Upload report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: frontend/playwright-report/
lighthouse:
name: Lighthouse & a11y
runs-on: ubuntu-latest
timeout-minutes: 30
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- run: npm ci --ignore-scripts
- run: npx playwright install --with-deps chromium
- run: npm run build
env:
NEXT_OUTPUT: export
NEXT_PUBLIC_STELLAR_NETWORK: testnet
NEXT_PUBLIC_HORIZON_URL: https://horizon-testnet.stellar.org
NEXT_PUBLIC_API_URL: http://localhost:4000
NEXT_PUBLIC_CONTRACT_ID: CCW67TSZV3SSS2HXMBQ52NVF3FB25GQ2G6E3BGLZ52B7W7TKG4E7SML2
- run: npm run test:a11y
- run: npm run test:a11y:full
- run: npx lhci autorun
compose:
name: Docker Compose
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: docker compose -f docker-compose.yml config --quiet
- run: docker compose -f docker-compose.prod.yml config --quiet