-
Notifications
You must be signed in to change notification settings - Fork 18
86 lines (83 loc) · 2.94 KB
/
e2e.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
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
name: Synpress tests
on:
pull_request:
# types: [closed]
branches: [main, wait-for-deploy-e2e]
jobs:
check-workflow-status:
runs-on: ubuntu-latest
outputs:
status: ${{ steps.check.outputs.status }}
steps:
- name: Check workflow status
id: check
run: |
status=""
count=0
while [[ "$status" != "completed" && $count -lt 100 ]]; do
response=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs")
echo $response
status=$(echo $response | jq -r '.workflow_runs[] | select(.name=="Centrifuge App") | .status')
if [ $count -eq 10 ]; then
echo "Workflow not completed in 100 minutes, exiting..."
exit 1
fi
if [[ "$status" != "completed" ]]; then
echo "Workflow not completed, waiting..."
sleep 60
count=$((count+1))
fi
done
echo "::set-output name=status::$status"
cypress-run:
needs: check-workflow-status
if: ${{ needs.check-workflow-status.outputs.status == 'completed' }}
runs-on: ubuntu-22.04
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install linux deps
run: |
sudo apt-get install --no-install-recommends -y \
fluxbox \
xvfb
- name: Run xvfb and fluxbox
run: |
Xvfb :0 -screen 0 1024x768x24 -listen tcp -ac &
fluxbox &
env:
DISPLAY: :0.0
- uses: iamsauravsharma/[email protected]
with:
# input-prefix: '' # Optional (default: '')
file-path: 'centrifuge-app/.env' # Optional (default : '.env')
# output-prefix: 'OUTPUT_' # Optional (default: '')
env: # env available for only this steps
CYPRESS_PRIVATE_KEY: ${{secrets.CYPRESS_PRIVATE_KEY}}
PRIVATE_KEY: ${{secrets.CYPRESS_PRIVATE_KEY}}
NETWORK_NAME: centrifuge
RPC_URL: https://fullnode.development.cntrfg.com
CHAIN_ID: 2000
SYMBOL: DEVEL
IS_TESTNET: true
DEBUG: true
- name: Synpress run
uses: cypress-io/github-action@v6
with:
working-directory: centrifuge-app
install-command: yarn
command: yarn run e2e:run:ci
browser: chrome
config-file: synpress.config.ts
ci-build-id: '${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}'
env:
# pass the Cypress Cloud record key as an environment variable
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CYPRESS_PRIVATE_KEY: ${{ secrets.CYPRESS_PRIVATE_KEY }}
PRIVATE_KEY: ${{ secrets.CYPRESS_PRIVATE_KEY }}
CYPRESS_BASE_URL: https://app-dev.k-f.dev
DISPLAY: :0.0