-
Notifications
You must be signed in to change notification settings - Fork 7
171 lines (154 loc) · 4.76 KB
/
e2e-run.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
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
---
name: ♻ E2E Run
on:
pull_request:
types:
- labeled
env:
# ----------------------------------------------------------------------------
# CI/CD
ARGOCD_URL: "${{ secrets.ARGOCD_URL }}"
ARGOCD_ACCESS_TOKEN: "${{ secrets.ARGOCD_ACCESS_TOKEN }}"
GITLAB_PAT_OCTANT_K8S_DEVOPS_REPOSITORY_WRITE: "${{ secrets.GITLAB_PAT_OCTANT_K8S_DEVOPS_REPOSITORY_WRITE }}"
jobs:
check-run-conditions:
name: Label check
if: contains(github.event.label.name, 'request-approval') # Check if the label is 'bug'
runs-on:
- general
steps:
- name: Check if user is an org member
run: |
echo "OK"
shell: bash
docker:
name: Docker
needs:
- check-run-conditions
uses: ./.github/workflows/tpl-images.yml
secrets: inherit
with:
image-tag: ${{ github.sha }}
git-ref: ${{ github.ref }}
start-e2e-env:
name: Start E2E Env
needs:
- check-run-conditions
uses: ./.github/workflows/tpl-start-env.yml
secrets: inherit
with:
env-type: e2e
git-ref: ${{ github.ref }}
pull-request-id: ${{ github.event.pull_request.number }}
workflow-id: ${{ github.run_id }}
deploy-e2e-env:
name: Deploy E2E Env
needs:
- docker
- start-e2e-env
uses: ./.github/workflows/tpl-deploy-app.yml
with:
# ---
env-type: e2e
branch-head-ref: ${{ github.ref }}
image-tag: ${{ github.sha }}
pull-request-id: ${{ github.event.pull_request.number }}
workflow-id: ${{ github.run_id }}
env-id: ${{ needs.start-e2e-env.outputs.env-id }}
deployment-id: ${{ needs.start-e2e-env.outputs.deployment-id }}
# ---
deploy-contracts: true
forward-first-epoch: true
chain-id: 1337
network-name: local
chain-name: localhost
snapshotter-enabled: false
multisigger-enabled: false
scheduler-enabled: true
glm-claim-enabled: true
vault-confirm-withdrawals-enabled: true
anvil-block-time: 5
ipfs-gateways: 'https://ipfs.octant.wildland.dev/ipfs/'
secrets: inherit
run-e2e-tests:
name: Run E2E Tests
needs:
- deploy-e2e-env
runs-on:
- e2e
container:
image: registry.gitlab.com/golemfoundation/devops/container-builder/octant/synpress-arch:4d64bd94
credentials:
username: "doesnt-matter"
password: "${{ secrets.GITLAB_PAT_CONTAINER_BUILDER_DOCKER_IMAGES_READ }}"
env:
ENV_TYPE: e2e
CI_MERGE_REQUEST_IID: ${{ github.event.pull_request.number }}
CI_PIPELINE_ID: ${{ github.run_id }}
CYPRESS_DOCKER_RUN: true
CI: true
METAMASK_VERSION: 10.25.0
SECRET_WORDS: test test test test test test test test test test test junk
CHAIN_ID: 1337
NETWORK_NAME: Local
SYMBOL: ETH
IS_TESTNET: true
VITE_NETWORK: Local
steps:
- uses: actions/[email protected]
- uses: actions/cache/restore@v4
with:
path: |-
${{ matrix.SERVICE }}/.yarn
${{ matrix.SERVICE }}/node-modules
key: "${{ github.sha }}-yarn-client"
- uses: actions/cache/restore@v4
with:
path: |-
${{ matrix.SERVICE }}/.yarn
${{ matrix.SERVICE }}/node-modules
key: "${{ github.sha }}-yarn-root"
- name: Run E2E tests
run: |
set -ex
export CI_PROJECT_DIR="${GITHUB_WORKSPACE}"
export OCTANT_BASE_URL=${{ needs.deploy-e2e-env.outputs.octant-web-url }}
export RPC_URL=${{ needs.deploy-e2e-env.outputs.anvil-rpc-url }}
export VITE_JSON_RPC_ENDPOINT=${{ needs.deploy-e2e-env.outputs.anvil-rpc-url }}
export VITE_SERVER_ENDPOINT=${{ needs.deploy-e2e-env.outputs.octant-backend-url }}/
# Setup NVM to use Node version 20
set +x
source /usr/share/nvm/init-nvm.sh
nvm install 20
nvm use 20
set -x
npm i -g yarn
pushd client
yarn install --cache-folder .yarn --frozen-lockfile --prefer-offline --no-audit
source /usr/bin/entrypoint.sh
curl --retry-connrefused --retry 100 --retry-delay 3 \
-s -X GET $OCTANT_BASE_URL
rm -rf $HOME/.config/Cypress
rm -rf $HOME/.config/google-chrome
yarn synpress:run
shell: bash
- uses: actions/[email protected]
if: failure()
with:
name: "${{ github.job }}"
retention-days: 3
path: |-
client/cypress/videos
client/cypress/screenshots
stop-e2e-env:
name: Stop E2E Env
needs:
- start-e2e-env
- run-e2e-tests
if: always() && (needs.start-e2e-env.result == 'success')
uses: ./.github/workflows/tpl-destroy-env.yml
secrets: inherit
with:
env-type: e2e
pull-request-id: ${{ github.event.pull_request.number }}
workflow-id: ${{ github.run_id }}