-
Notifications
You must be signed in to change notification settings - Fork 149
144 lines (118 loc) · 4.56 KB
/
Copy pathfrontend.yml
File metadata and controls
144 lines (118 loc) · 4.56 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
name: Frontend CI
on:
pull_request:
branches: [main]
paths:
- "Dechat/dex_with_fiat_frontend/**"
- ".github/workflows/frontend.yml"
push:
branches: [main]
paths:
- "Dechat/dex_with_fiat_frontend/**"
permissions:
contents: read
jobs:
build:
name: Build & Type Check
runs-on: ubuntu-latest
defaults:
run:
working-directory: Dechat/dex_with_fiat_frontend
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "24"
cache: "pnpm"
cache-dependency-path: Dechat/dex_with_fiat_frontend/pnpm-lock.yaml
- name: Install dependencies
run: pnpm install
- name: Type check
run: pnpm tsc --noEmit
- name: Lint
run: pnpm lint
- name: Build
run: pnpm build
env:
NEXT_PUBLIC_STELLAR_CONTRACT_ID: ${{ secrets.NEXT_PUBLIC_STELLAR_CONTRACT_ID || 'PLACEHOLDER' }}
NEXT_PUBLIC_XLM_SAC_ID: ${{ secrets.NEXT_PUBLIC_XLM_SAC_ID || 'PLACEHOLDER' }}
NEXT_PUBLIC_STELLAR_RPC_URL: ${{ secrets.NEXT_PUBLIC_STELLAR_RPC_URL || 'https://soroban-testnet.stellar.org' }}
NEXT_PUBLIC_STELLAR_NETWORK: ${{ secrets.NEXT_PUBLIC_STELLAR_NETWORK || 'TESTNET' }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY || 'PLACEHOLDER' }}
PAYSTACK_SECRET_KEY: ${{ secrets.PAYSTACK_SECRET_KEY || 'PLACEHOLDER' }}
PAYOUT_PROVIDER: ${{ secrets.PAYOUT_PROVIDER || 'paystack' }}
- name: Unit tests with coverage (shard 1/4)
run: pnpm test:coverage:shard:1
env:
NODE_OPTIONS: --max-old-space-size=8192
- name: Unit tests with coverage (shard 2/4)
run: pnpm test:coverage:shard:2
env:
NODE_OPTIONS: --max-old-space-size=8192
- name: Unit tests with coverage (shard 3/4)
run: pnpm test:coverage:shard:3
env:
NODE_OPTIONS: --max-old-space-size=8192
- name: Unit tests with coverage (shard 4/4)
run: pnpm test:coverage:shard:4
env:
NODE_OPTIONS: --max-old-space-size=8192
- name: Merge coverage reports
run: pnpm test:coverage:merge
env:
NODE_OPTIONS: --max-old-space-size=4096
# Fails the pipeline if coverage thresholds (stmt 70%, branch 65%, fn 70%) are not met
e2e:
name: Playwright E2E Tests
runs-on: ubuntu-latest
needs: build
defaults:
run:
working-directory: Dechat/dex_with_fiat_frontend
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "24"
cache: "pnpm"
cache-dependency-path: Dechat/dex_with_fiat_frontend/pnpm-lock.yaml
- name: Install dependencies
run: pnpm install
- name: Install Playwright browsers
run: pnpm test:e2e:install
- name: Build for E2E
run: pnpm build
env:
NEXT_PUBLIC_STELLAR_CONTRACT_ID: ${{ secrets.NEXT_PUBLIC_STELLAR_CONTRACT_ID || 'PLACEHOLDER' }}
NEXT_PUBLIC_XLM_SAC_ID: ${{ secrets.NEXT_PUBLIC_XLM_SAC_ID || 'PLACEHOLDER' }}
NEXT_PUBLIC_STELLAR_RPC_URL: ${{ secrets.NEXT_PUBLIC_STELLAR_RPC_URL || 'https://soroban-testnet.stellar.org' }}
NEXT_PUBLIC_STELLAR_NETWORK: ${{ secrets.NEXT_PUBLIC_STELLAR_NETWORK || 'TESTNET' }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY || 'PLACEHOLDER' }}
PAYSTACK_SECRET_KEY: ${{ secrets.PAYSTACK_SECRET_KEY || 'PLACEHOLDER' }}
PAYOUT_PROVIDER: ${{ secrets.PAYOUT_PROVIDER || 'paystack' }}
- name: Run Playwright E2E tests
run: pnpm test:e2e
env:
NEXT_PUBLIC_STELLAR_CONTRACT_ID: ${{ secrets.NEXT_PUBLIC_STELLAR_CONTRACT_ID || 'PLACEHOLDER' }}
NEXT_PUBLIC_XLM_SAC_ID: ${{ secrets.NEXT_PUBLIC_XLM_SAC_ID || 'PLACEHOLDER' }}
NEXT_PUBLIC_STELLAR_RPC_URL: ${{ secrets.NEXT_PUBLIC_STELLAR_RPC_URL || 'https://soroban-testnet.stellar.org' }}
NEXT_PUBLIC_STELLAR_NETWORK: ${{ secrets.NEXT_PUBLIC_STELLAR_NETWORK || 'TESTNET' }}
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: Dechat/dex_with_fiat_frontend/playwright-report/
retention-days: 7