-
Notifications
You must be signed in to change notification settings - Fork 273
683 lines (581 loc) · 21.8 KB
/
pull-request.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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
name: Run all tests
on:
push:
branches:
- develop
pull_request:
jobs:
build-all-artifacts:
runs-on: ubuntu-latest
strategy:
matrix:
env: [prod, staging, hydrogen, dev]
extension_type: [chrome, firefox]
environment: ${{ matrix.env }}
env:
# FEATURE flags
FEATURE_PRIVACY_SETTINGS: "true"
FEATURE_EXPERIMENTAL_SETTINGS: "false"
FEATURE_BETA_FEATURES: "false"
FEATURE_BANXA: "true"
FEATURE_LAYERSWAP: "true"
FEATURE_ORBITER: "true"
FEATURE_VERIFIED_DAPPS: "true"
FEATURE_MULTISIG: "true"
FEATURE_ACTIVITY_V2: "true"
# API URLs
ARGENT_API_BASE_URL: ${{ vars.ARGENT_API_BASE_URL }}
ARGENT_X_STATUS_URL: ${{ vars.ARGENT_X_STATUS_URL }}
ARGENT_X_NEWS_URL: ${{ vars.ARGENT_X_NEWS_URL }}
ARGENT_TESTNET_RPC_URL: ${{ vars.ARGENT_TESTNET_RPC_URL }}
ARGENT_HEALTHCHECK_BASE_URL: ${{ vars.ARGENT_HEALTHCHECK_BASE_URL }}
# API ENVIRONMENT
ARGENT_X_ENVIRONMENT: ${{ matrix.env }}
# Sentry
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ENVIRONMENT: "staging"
# Misc
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY }}
RAMP_API_KEY: ${{ secrets.RAMP_API_KEY }}
SAFE_ENV_VARS: false
MULTICALL_MAX_BATCH_SIZE: 20
NEW_CAIRO_0_ENABLED: false
TOPPER_PEM_KEY: ${{ secrets.TOPPER_PEM_KEY }}
# Refresh intervals
FAST: 20 # 20s
MEDIUM: 60 # 60s
SLOW: 60 * 5 # 5m
VERY_SLOW: 24 * 60 * 60 # 1d
#For testing only
FEE_OVERHEAD: 2
steps:
# Setup Project
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: 9
run_install: false
- uses: actions/setup-node@v4
with:
node-version: "18.x"
cache: "pnpm"
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Setup project
run: pnpm run setup
- name: Build extension for ${{ matrix.extension_type }}
run: |
if [[ "${{ matrix.extension_type }}" == "firefox" ]]; then
MANIFEST_VERSION=v2 pnpm run build:extension
else
MANIFEST_VERSION=v3 pnpm run build:extension
fi
- name: Check bundlesize for ${{ matrix.extension_type }}
run: pnpm bundlewatch
- name: Use Cache
uses: actions/cache@v4
with:
path: ./*
key: ${{ github.sha }}-${{ matrix.extension_type }}-${{ matrix.env }}
- name: Set filename prefix
run: echo "FILENAME_PREFIX=$(echo argent-x-${{ matrix.env }}-${{ github.ref_name }} | tr / -)" >> $GITHUB_ENV
- name: Create ${{ matrix.extension_type }} zip
run: (cd ./packages/extension/dist && zip -r "../../../${{ env.FILENAME_PREFIX }}-${{ matrix.extension_type }}" .)
- name: Upload ${{ matrix.extension_type }} extension
uses: actions/upload-artifact@v4
with:
name: ${{ env.FILENAME_PREFIX }}-${{ matrix.extension_type }}
path: "*-${{ matrix.extension_type }}.zip"
retention-days: 3
test-unit:
runs-on: ubuntu-latest
needs: [build-all-artifacts]
environment: "hydrogen" # test-unit is always run against hydrogen
env:
ARGENT_API_BASE_URL: ${{ vars.ARGENT_API_BASE_URL }}
ARGENT_TESTNET_RPC_URL: ${{ vars.ARGENT_TESTNET_RPC_URL }}
ARGENT_HEALTHCHECK_BASE_URL: ${{ vars.ARGENT_HEALTHCHECK_BASE_URL }}
ARGENT_X_STATUS_URL: ${{ vars.ARGENT_X_STATUS_URL }}
ARGENT_X_NEWS_URL: ${{ vars.ARGENT_X_NEWS_URL }}
ARGENT_X_ENVIRONMENT: "hydrogen"
FEATURE_MULTISIG: "true"
services:
devnet:
image: shardlabs/starknet-devnet-rs:0.0.7-seed0
ports:
- 5050:5050
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: 9
run_install: false
- uses: actions/setup-node@v4
with:
node-version: "18.x"
cache: "pnpm"
- name: Restore pnpm cache
uses: actions/cache@v4
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Restore cached build
uses: actions/cache@v4
with:
path: ./*
key: ${{ github.sha }}-chrome-hydrogen # test-unit is always run against chrome-hydrogen build
- name: Lint
run: pnpm run lint
- name: Run tests
run: pnpm run test:ci
- name: SonarCloud Scan
# TODO replace with master as soon as sonarcloud fixes the issue with action https://community.sonarsource.com/t/sonarsource-sonarcloud-github-action-failing-with-node-js-12-error/89664/2
uses: SonarSource/[email protected]
with:
projectBaseDir: ./packages/extension
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
test-e2e:
runs-on: ubuntu-latest
needs: [build-all-artifacts]
strategy:
matrix:
project: [ArgentX]
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8]
shardTotal: [8]
env:
#default
ARGENT_X_ENVIRONMENT: "hydrogen"
ARGENT_API_BASE_URL: ${{ secrets.ARGENT_API_BASE_URL }}
## BANK ACCOUNT, USED FOR FUND OTHER ACCOUNTS
E2E_SENDER_ADDRESSES: ${{ secrets.E2E_SENDER_ADDRESSES_SEPOLIA }}
E2E_SENDER_PRIVATEKEYS: ${{ secrets.E2E_SENDER_PRIVATEKEYS_SEPOLIA }}
ARGENT_SEPOLIA_RPC_URL: ${{ secrets.ARGENT_SEPOLIA_RPC_URL }}
##slack config
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
E2E_TESTNET_SEED1: ${{ secrets.E2E_TESTNET_SEED1 }}
E2E_TESTNET_SEED3: ${{ secrets.E2E_TESTNET_SEED3 }}
E2E_TESTNET_SEED4: ${{ secrets.E2E_TESTNET_SEED4 }}
E2E_ACCOUNT_1_SEED2: ${{ secrets.E2E_ACCOUNT_1_SEED2 }}
## BANK ACCOUNT, USED FOR FUND OTHER ACCOUNTS
E2E_SENDER_SEED: ${{ secrets.E2E_SENDER_SEED }}
E2E_SPOK_CAMPAIGN_URL: ${{ secrets.E2E_SPOK_CAMPAIGN_URL }}
E2E_SPOK_CAMPAIGN_NAME: ${{ secrets.E2E_SPOK_CAMPAIGN_NAME }}
E2E_USE_STRK_AS_FEE_TOKEN: ${{ secrets.E2E_USE_STRK_AS_FEE_TOKEN }}
E2E_SKIP_TX_TESTS: ${{ secrets.E2E_SKIP_TX_TESTS}}
E2E_LOG_INFO: ${{ secrets.E2E_LOG_INFO }}
E2E_GUARDIAN_EMAIL: ${{ secrets.E2E_GUARDIAN_EMAIL }}
# Refresh intervals
REFRESH_INTERVAL_FAST: 1 # 1s
REFRESH_INTERVAL_MEDIUM: 5 # 5s
REFRESH_INTERVAL_SLOW: 20 # 20s
REFRESH_INTERVAL_VERY_SLOW: 60 * 10 # 10m
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: 9
run_install: false
- uses: actions/setup-node@v4
with:
node-version: "18.x"
cache: "pnpm"
- name: Restore pnpm cache
uses: actions/cache@v4
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Restore cached build
uses: actions/cache@v4
with:
path: ./*
key: ${{ github.sha }}-chrome-${{ env.ARGENT_X_ENVIRONMENT }} # test-e2e is always run against chrome-hydrogen build
- name: Install Playwright Browsers
run: npx playwright install chromium
- name: Run e2e tests
run: xvfb-run --auto-servernum pnpm test:e2e:extension --project=${{ matrix.project }} --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: test-artifacts-${{ matrix.shardIndex }}
path: |
packages/e2e/artifacts/playwright/
!packages/e2e/artifacts/playwright/*.webm
retention-days: 5
- name: Upload blob report to GitHub Actions Artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: all-blob-reports-${{ matrix.shardIndex }}
path: packages/e2e/blob-report/
retention-days: 5
test-e2e-prod:
runs-on: ubuntu-latest
needs: [build-all-artifacts]
strategy:
matrix:
project: [ArgentX]
shardIndex: [1, 2]
shardTotal: [2]
env:
#default
ARGENT_X_ENVIRONMENT: "prod"
## BANK ACCOUNT, USED FOR FUND OTHER ACCOUNTS
E2E_SENDER_ADDRESSES: ${{ secrets.E2E_SENDER_ADDRESSES }}
E2E_SENDER_PRIVATEKEYS: ${{ secrets.E2E_SENDER_PRIVATEKEYS }}
ARGENT_MAINNET_RPC_URL: ${{ secrets.ARGENT_MAINNET_RPC_URL }}
ARGENT_SEPOLIA_RPC_URL: ${{ secrets.ARGENT_SEPOLIA_RPC_URL }}
##slack config
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
E2E_MAINNET_SEED1: ${{ secrets.E2E_MAINNET_SEED1 }}
## BANK ACCOUNT, USED FOR FUND OTHER ACCOUNTS
E2E_SENDER_SEED: ${{ secrets.E2E_SENDER_SEED }}
# Refresh intervals
REFRESH_INTERVAL_FAST: 1 # 1s
REFRESH_INTERVAL_MEDIUM: 5 # 5s
REFRESH_INTERVAL_SLOW: 20 # 20s
REFRESH_INTERVAL_VERY_SLOW: 60 * 10 # 10m
E2E_LOG_INFO: ${{ secrets.E2E_LOG_INFO }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: 9
run_install: false
- uses: actions/setup-node@v4
with:
node-version: "18.x"
cache: "pnpm"
- name: Restore pnpm cache
uses: actions/cache@v4
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Restore cached build
uses: actions/cache@v4
with:
path: ./*
key: ${{ github.sha }}-chrome-${{ env.ARGENT_X_ENVIRONMENT }}
- name: Install Playwright Browsers
run: npx playwright install chromium
- name: Run e2e prod tests
run: xvfb-run --auto-servernum pnpm test:e2e:extension:prod --project=${{ matrix.project }} --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: test-artifacts-prod-${{ matrix.shardIndex }}
path: |
packages/e2e/artifacts/playwright/
!packages/e2e/artifacts/playwright/*.webm
retention-days: 5
- name: Upload blob report to GitHub Actions Artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: all-blob-reports-prod-${{ matrix.shardIndex }}
path: packages/e2e/blob-report/
retention-days: 5
test-e2e-tx:
runs-on: ubuntu-latest
needs: [build-all-artifacts]
strategy:
matrix:
project: [ArgentX]
shardIndex: [1, 2, 3, 4]
shardTotal: [4]
env:
#default
ARGENT_X_ENVIRONMENT: "hydrogen"
ARGENT_API_BASE_URL: ${{ secrets.ARGENT_API_BASE_URL }}
## BANK ACCOUNT, USED FOR FUND OTHER ACCOUNTS
E2E_SENDER_ADDRESSES: ${{ secrets.E2E_SENDER_ADDRESSES_SEPOLIA }}
E2E_SENDER_PRIVATEKEYS: ${{ secrets.E2E_SENDER_PRIVATEKEYS_SEPOLIA }}
ARGENT_SEPOLIA_RPC_URL: ${{ secrets.ARGENT_SEPOLIA_RPC_URL }}
##slack config
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
E2E_TESTNET_SEED1: ${{ secrets.E2E_TESTNET_SEED1 }}
E2E_TESTNET_SEED3: ${{ secrets.E2E_TESTNET_SEED3 }}
E2E_TESTNET_SEED4: ${{ secrets.E2E_TESTNET_SEED4 }}
E2E_ACCOUNT_1_SEED2: ${{ secrets.E2E_ACCOUNT_1_SEED2 }}
## BANK ACCOUNT, USED FOR FUND OTHER ACCOUNTS
E2E_SENDER_SEED: ${{ secrets.E2E_SENDER_SEED }}
E2E_SPOK_CAMPAIGN_URL: ${{ secrets.E2E_SPOK_CAMPAIGN_URL }}
E2E_SPOK_CAMPAIGN_NAME: ${{ secrets.E2E_SPOK_CAMPAIGN_NAME }}
E2E_USE_STRK_AS_FEE_TOKEN: ${{ secrets.E2E_USE_STRK_AS_FEE_TOKEN }}
E2E_SKIP_TX_TESTS: ${{ secrets.E2E_SKIP_TX_TESTS}}
E2E_LOG_INFO: ${{ secrets.E2E_LOG_INFO }}
E2E_GUARDIAN_EMAIL: ${{ secrets.E2E_GUARDIAN_EMAIL }}
# Refresh intervals
REFRESH_INTERVAL_FAST: 1 # 1s
REFRESH_INTERVAL_MEDIUM: 5 # 5s
REFRESH_INTERVAL_SLOW: 20 # 20s
REFRESH_INTERVAL_VERY_SLOW: 60 * 10 # 10m
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: 9
run_install: false
- uses: actions/setup-node@v4
with:
node-version: "18.x"
cache: "pnpm"
- name: Restore pnpm cache
uses: actions/cache@v4
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Restore cached build
uses: actions/cache@v4
with:
path: ./*
key: ${{ github.sha }}-chrome-${{ env.ARGENT_X_ENVIRONMENT }}
- name: Install Playwright Browsers
run: npx playwright install chromium
- name: Run e2e tx tests
run: xvfb-run --auto-servernum pnpm test:e2e:extension:tx --project=${{ matrix.project }} --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: test-artifacts-tx-${{ matrix.shardIndex }}
path: |
packages/e2e/artifacts/playwright/
!packages/e2e/artifacts/playwright/*.webm
retention-days: 5
- name: Upload blob report to GitHub Actions Artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: all-blob-reports-tx-${{ matrix.shardIndex }}
path: packages/e2e/blob-report/
retention-days: 5
test-notify-low-balance:
runs-on: ubuntu-latest
if: always()
needs: [build-all-artifacts, test-e2e, test-e2e-prod]
env:
ARGENT_X_ENVIRONMENT: "hydrogen"
ARGENT_API_BASE_URL: ${{ secrets.ARGENT_API_BASE_URL }}
## BANK ACCOUNT, USED FOR FUND OTHER ACCOUNTS
E2E_SENDER_ADDRESSES: ${{ secrets.E2E_SENDER_ADDRESSES_SEPOLIA }}
E2E_SENDER_PRIVATEKEYS: ${{ secrets.E2E_SENDER_PRIVATEKEYS_SEPOLIA }}
ARGENT_SEPOLIA_RPC_URL: ${{ secrets.ARGENT_SEPOLIA_RPC_URL }}
##slack config
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: 9
run_install: false
- uses: actions/setup-node@v4
with:
node-version: "18.x"
cache: "pnpm"
- name: Restore pnpm cache
uses: actions/cache@v4
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Restore cached build
uses: actions/cache@v4
with:
path: ./*
key: ${{ github.sha }}-chrome-${{ env.ARGENT_X_ENVIRONMENT }} # test-e2e is always run against chrome-hydrogen build
- name: Slack notifications
run: pnpm run test:e2e:slack-notifications
merge-reports:
needs: [test-e2e, test-e2e-prod]
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: 9
run_install: false
- uses: actions/setup-node@v4
with:
node-version: "18.x"
cache: "pnpm"
- name: Restore pnpm cache
uses: actions/cache@v4
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
path: all-blob-reports
pattern: all-blob-reports-*
merge-multiple: true
- name: Merge into HTML Report
run: npx playwright merge-reports -c ./packages/e2e/merge-reports.config.js ./all-blob-reports
- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: html-report--attempt-${{ github.run_attempt }}
path: packages/e2e/playwright-report
retention-days: 14
add_pr_comments:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' && github.actor != 'dependabot[bot]'}} # Run only for pull requests and if not triggered by dependabot
needs: [build-all-artifacts, test-unit, test-e2e, test-e2e-prod]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: 9
run_install: false
- uses: actions/setup-node@v4
with:
node-version: "18.x"
cache: "pnpm"
- name: Restore pnpm cache
uses: actions/cache@v4
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Set GHA_BRANCH
run: echo "GHA_BRANCH=$(echo $GITHUB_REF | awk -F / '{print $3}')" >> $GITHUB_ENV
- name: Comment PR
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr comment ${{ env.GHA_BRANCH }} --body "[Builds for local testing](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
create_sentry_release:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' && github.actor != 'dependabot[bot]'}} # Run only for pull requests and if not triggered by dependabot
needs: [build-all-artifacts, test-unit, test-e2e, test-e2e-prod]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: 9
run_install: false
- uses: actions/setup-node@v4
with:
node-version: "18.x"
cache: "pnpm"
- name: Restore cached build
uses: actions/cache@v4
with:
path: ./*
key: ${{ github.sha }}-chrome-hydrogen
- name: Get Extension version
id: package-version
run: |
PACKAGE_VERSION=$(cat ./packages/extension/package.json | jq -r '.version')
echo "current-version=${PACKAGE_VERSION}" >> $GITHUB_OUTPUT
- name: Check sourcemaps
run: |
ls -l ./packages/extension
if [ ! -d "./packages/extension/sourcemaps" ]; then
echo "No sourcemaps found"
exit 0
fi
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_LOG_LEVEL: debug
with:
environment: ${{ env.SENTRY_ENVIRONMENT }}
sourcemaps: "./packages/extension/dist ./packages/extension/sourcemaps"
url_prefix: "~/"
version: ${{ steps.package-version.outputs.current-version }}-rc__${{ github.sha }}
ignore_missing: true
slack_notif:
runs-on: ubuntu-latest
if: always()
needs: [test-unit, test-e2e]
steps:
- name: Send notification to Slack
uses: 8398a7/[email protected]
with:
status: custom
custom_payload: |
{
text: "*ArgentX* - ${{ env.BUILD_TYPE }} - ${{ env.BUILD_STATUS == 'good' && 'SUCCESS' || 'FAILED' }}",
attachments: [{
fallback: 'fallback',
color: '${{ env.BUILD_STATUS }}',
title: `Artifacts for testing ${{ env.BUILD_TYPE }} <${{ github.server_url }}/${{ github.repository }}/pull/${{ github.event.number }}|${{ github.event.number }} ${{ github.event.pull_request.title }}>`,
text: '<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts|Artifacts link>',
fields: [{},],
actions: [{}]}]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_TYPE: ${{ github.event_name == 'pull_request' && 'pull request' || 'develop' }}
BUILD_STATUS: ${{ needs.test-unit.result == 'success' && needs.test-e2e.result == 'success' && 'good' || 'danger' }}
check-ampli:
runs-on: ubuntu-latest
needs: [build-all-artifacts]
container:
image: amplitudeinc/ampli
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Verify analytics implementation and update status in Data
run: pwd && ampli status -t ${{secrets.AMPLI_TOKEN}} --update
working-directory: ./packages/extension