-
Notifications
You must be signed in to change notification settings - Fork 3
142 lines (142 loc) · 6.18 KB
/
e2e_testing.yaml
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
name: E2E Testing
on:
push:
branches:
- main
pull_request:
branches:
- main
types: [opened, reopened, 'synchronize', 'ready_for_review']
jobs:
build:
runs-on: ubuntu-latest-16-cores-core-extension
if: ${{ !github.event.pull_request.draft }}
environment: alpha
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Checkout extension
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Create .npmrc
run: echo '//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}' >> .npmrc
- name: Create env file
run: |
touch .env.production
echo RELEASE=alpha >> .env.production
echo POSTHOG_KEY=${{ secrets.POSTHOG_KEY }} >> .env.production
echo POSTHOG_URL=${{ secrets.POSTHOG_URL }} >> .env.production
echo ANALYTICS_ENCRYPTION_KEY=${{ secrets.ANALYTICS_ENCRYPTION_KEY }} >> .env.production
echo ANALYTICS_ENCRYPTION_KEY_ID=${{ secrets.ANALYTICS_ENCRYPTION_KEY_ID }} >> .env.production
echo COVALENT_API_KEY=${{ secrets.COVALENT_API_KEY }} >> .env.production
echo GLACIER_URL=${{ secrets.GLACIER_URL }} >> .env.production
echo PROXY_URL=${{ secrets.PROXY_URL }} >> .env.production
echo CORE_EXTENSION_LANDING_URL=${{ secrets.CORE_EXTENSION_LANDING_URL }} >> .env.production
echo SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> .env.production
echo CORE_WEB_BASE_URL=${{ secrets.CORE_WEB_BASE_URL }} >> .env.production
echo GLACIER_API_KEY=${{ secrets.GLACIER_API_KEY }} >> .env.production
echo WALLET_CONNECT_PROJECT_ID=${{ secrets.WALLET_CONNECT_PROJECT_ID }} >> .env.production
echo SEEDLESS_URL=${{ secrets.SEEDLESS_URL }} >> .env.production
echo SEEDLESS_ORG_ID=${{ secrets.SEEDLESS_ORG_ID }} >> .env.production
echo GOOGLE_OAUTH_CLIENT_ID=${{ secrets.GOOGLE_OAUTH_CLIENT_ID }} >> .env.production
echo APPLE_OAUTH_CLIENT_ID=${{ secrets.APPLE_OAUTH_CLIENT_ID }} >> .env.production
echo APPLE_OAUTH_REDIRECT_URL=${{ secrets.APPLE_OAUTH_REDIRECT_URL }} >> .env.production
echo CUBESIGNER_ENV=${{ secrets.CUBESIGNER_ENV }} >> .env.production
echo SEEDLESS_FIDO_IDENTITY_URL=${{ secrets.SEEDLESS_FIDO_IDENTITY_URL }} >> .env.production
echo NEWSLETTER_BASE_URL=${{ secrets.NEWSLETTER_BASE_URL }} >> .env.production
echo NEWSLETTER_PORTAL_ID=${{ secrets.NEWSLETTER_PORTAL_ID }} >> .env.production
echo NEWSLETTER_FORM_ID=${{ secrets.NEWSLETTER_FORM_ID }} >> .env.production
- name: Install dependencies
run: yarn setup
- name: Build library
run: yarn build:alpha
- name: Remove onboarding video
run: |
rm -fv ./dist/images/core-ext-hero-hq.webm
- name: Add extension key to manifest file
run: |
echo $(cat ./dist/manifest.json | jq '.key = "${{ secrets.EXTENSION_PUBLIC_KEY }}"') > ./dist/manifest.json
- name: Generate a zip
run: yarn zip
- name: Output extension file version before renaming
run: ls builds/*.zip
- name: Rename extension file
run: |
mv builds/*.zip builds/extension.zip
mv builds/extension.zip ${GITHUB_WORKSPACE}
- name: Upload builded zip file
uses: actions/upload-artifact@v4
with:
name: extension
path: extension.zip
e2e:
runs-on: ubuntu-latest-16-cores-core-extension
needs: build
name: Run E2E Smoke Tests
environment: e2e
env:
RUNNER: CI
LOG_LEVEL: info
POST_TO_TESTRAIL: true
TESTRAIL_API_KEY: ${{secrets.TESTRAIL_API_KEY}}
RECOVERY_PHRASE: ${{secrets.RECOVERY_PHRASE}}
METAMASK_RECOVERY_PHRASE: ${{secrets.METAMASK_RECOVERY_PHRASE}}
APITOKEN_ETHERSCAN: ${{secrets.APITOKEN_ETHERSCAN}}
APITOKEN_CRYPTOAPIS: ${{secrets.APITOKEN_CRYPTOAPIS}}
APITOKEN_SNOWTRACE: ${{secrets.APITOKEN_SNOWTRACE}}
steps:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Checkout automation repo
uses: actions/checkout@v4
with:
repository: 'ava-labs/avalanche-test-automation'
path: './'
ssh-key: ${{ secrets.SSH_DEPLOY_KEY }}
- name: Install automation repo dependencies
run: yarn install
- name: Download builded zip file
uses: actions/download-artifact@v4
with:
name: extension
- name: Running browser extension smoke tests on testnet/mainnet against generated zip
run: yarn ext:testnet/mainnet-smoke
- if: always()
name: Set Testrail Run ID ENV
run: |
echo $(head -n 1 testrail_run_id.txt)
echo "TESTRAIL_RUN_ID=$(head -n 1 testrail_run_id.txt)" >> $GITHUB_ENV
- name: Success slack notification
if: success()
uses: slackapi/[email protected]
with:
payload: |
{
"GH_RUN_LINK": "https://github.com/ava-labs/core-extension/actions/runs/${{ github.run_id }}",
"GH_RUN_STATUS": "PASSED",
"STATUS_EMOJI": ":white_check_mark:",
"TEST_RUN_TYPE": "Browser extension smoke tests are running against branch= ${{ github.head_ref }}",
"TR_RUN_LINK": "https://avalabs.testrail.io/index.php?/runs/view/${{ env.TESTRAIL_RUN_ID }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: Failure slack notification
if: failure()
uses: slackapi/[email protected]
with:
payload: |
{
"GH_RUN_LINK": "https://github.com/ava-labs/core-extension/actions/runs/${{ github.run_id }}",
"GH_RUN_STATUS": "FAILED",
"STATUS_EMOJI": ":alert:",
"TEST_RUN_TYPE": "Browser extension smoke tests are running against branch= ${{ github.head_ref }}",
"TR_RUN_LINK": "https://avalabs.testrail.io/index.php?/runs/view/${{ env.TESTRAIL_RUN_ID }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}