forked from informalsystems/cycles-quartz
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.68 KB
/
e2e-tests.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
name: E2E tests
on:
pull_request:
types: [synchronize, ready_for_review]
jobs:
tests:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20.x"
check-latest: true
- name: Run Backend stack
run: docker compose -f docker/docker-compose.yml up -d --build
- name: Wait for enclave to listen
timeout-minutes: 25
run: |
echo "Waiting for handshake completion..."
while ! docker logs enclave 2>&1 | grep -q "Enclave is listening"; do
sleep 30
done
- name: Capture logs from CLI
working-directory: examples/fairblock/frontend
run: docker logs --tail 50 enclave &> enclave.logs.txt
- name: Setup Frontend environment variables for quartz
working-directory: examples/fairblock/frontend
run: |
cp .env.example .env.local
sed -i "s/^NEXT_PUBLIC_TRANSFERS_CONTRACT_ADDRESS=.*/NEXT_PUBLIC_TRANSFERS_CONTRACT_ADDRESS=$(grep 'Contract Address:' enclave.logs.txt | awk '{print $NF}')/" .env.local
sed -i "s/^NEXT_PUBLIC_ENCLAVE_PUBLIC_KEY=.*/NEXT_PUBLIC_ENCLAVE_PUBLIC_KEY=$(grep 'Handshake complete:' enclave.logs.txt | awk '{print $NF}')/" .env.local
- name: Install Frontend dependencies
working-directory: examples/fairblock/frontend
run: npm ci
- name: Run all E2E tests
working-directory: examples/fairblock/frontend
run: xvfb-run --auto-servernum --server-num=1 --server-args='-screen 0, 1920x1080x24' npm run test