Skip to content

fix: Readme issues.

fix: Readme issues. #9

Workflow file for this run

name: Run all tests
on:
push:
branches:
- develop
pull_request:
env:
PNPM_VERSION: 9
NODE_VERSION: 18.x
jobs:
build-alpha:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.48.2-jammy
strategy:
matrix:
env: [hydrogen]
extension_type: [chrome]
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_MULTISIG: "true"
ENABLE_TOKEN_DETAILS: "true"
FEATURE_DEFI_DECOMPOSITION: "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 }}
# API ENVIRONMENT
ARGENT_X_ENVIRONMENT: ${{ matrix.env }}
# Sentry
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_ENVIRONMENT: "staging"
# Misc
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
MIN_LEDGER_APP_VERSION: 2.2.1
#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: ${{ env.PNPM_VERSION }}
run_install: false
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
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: Set Sentry Release name (rc)
run: |
PACKAGE_VERSION=$(grep -m1 '"version":' ./packages/extension/package.json | awk -F: '{ print $2 }' | sed 's/[", ]//g')
echo "SENTRY_RELEASE=${PACKAGE_VERSION}-rc__${GITHUB_SHA}" >> $GITHUB_ENV
- name: Setup project
run: pnpm run setup
- name: Build extension for ${{ matrix.extension_type }}
run: |
if [ "${{ matrix.extension_type }}" = "firefox" ]; then
echo "Building extension using manifest v2"
MANIFEST_VERSION=v2 pnpm run build:extension:alpha
else
echo "Building extension using manifest v3"
MANIFEST_VERSION=v3 pnpm run build:extension:alpha
fi
- name: Check bundle size for ${{ matrix.extension_type }}
run: pnpm check-bundle-size
- 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: Install zip
run: apt-get update && apt-get install -y zip
- name: Create ${{ matrix.extension_type }} zip
run: (cd ./packages/extension/dist && zip -r "../../../${{ env.FILENAME_PREFIX }}-${{ matrix.extension_type }}-alpha" .)
- name: Upload ${{ matrix.extension_type }} extension
uses: actions/upload-artifact@v4
with:
name: ${{ env.FILENAME_PREFIX }}-${{ matrix.extension_type }}-alpha
path: "*-${{ matrix.extension_type }}-alpha.zip"
retention-days: 3
build-beta:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.48.2-jammy
strategy:
matrix:
env: [prod]
extension_type: [chrome]
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_MULTISIG: "true"
ENABLE_TOKEN_DETAILS: "true"
FEATURE_DEFI_DECOMPOSITION: "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 }}
# API ENVIRONMENT
ARGENT_X_ENVIRONMENT: ${{ matrix.env }}
# Sentry
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_ENVIRONMENT: "staging"
# Misc
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
MIN_LEDGER_APP_VERSION: 2.2.1
#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: ${{ env.PNPM_VERSION }}
run_install: false
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
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: Set Sentry Release name (rc)
run: |
PACKAGE_VERSION=$(grep -m1 '"version":' ./packages/extension/package.json | awk -F: '{ print $2 }' | sed 's/[", ]//g')
echo "SENTRY_RELEASE=${PACKAGE_VERSION}-rc__${GITHUB_SHA}" >> $GITHUB_ENV
- name: Setup project
run: pnpm run setup
- name: Build extension for ${{ matrix.extension_type }}
run: |
if [ "${{ matrix.extension_type }}" = "firefox" ]; then
echo "Building extension using manifest v2"
MANIFEST_VERSION=v2 pnpm run build:extension:beta
else
echo "Building extension using manifest v3"
MANIFEST_VERSION=v3 pnpm run build:extension:beta
fi
- name: Check bundle size for ${{ matrix.extension_type }}
run: pnpm check-bundle-size
- 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: Install zip
run: apt-get update && apt-get install -y zip
- name: Create ${{ matrix.extension_type }} zip
run: (cd ./packages/extension/dist && zip -r "../../../${{ env.FILENAME_PREFIX }}-${{ matrix.extension_type }}-beta" .)
- name: Upload ${{ matrix.extension_type }} extension
uses: actions/upload-artifact@v4
with:
name: ${{ env.FILENAME_PREFIX }}-${{ matrix.extension_type }}-beta
path: "*-${{ matrix.extension_type }}-beta.zip"
retention-days: 3
build-all-artifacts:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.48.2-jammy
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_MULTISIG: "true"
ENABLE_TOKEN_DETAILS: "true"
FEATURE_DEFI_DECOMPOSITION: "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 }}
# API ENVIRONMENT
ARGENT_X_ENVIRONMENT: ${{ matrix.env }}
# Sentry
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_ENVIRONMENT: "staging"
# Misc
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
MIN_LEDGER_APP_VERSION: 2.2.1
#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: ${{ env.PNPM_VERSION }}
run_install: false
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
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: Set Sentry Release name (rc)
run: |
PACKAGE_VERSION=$(grep -m1 '"version":' ./packages/extension/package.json | awk -F: '{ print $2 }' | sed 's/[", ]//g')
echo "SENTRY_RELEASE=${PACKAGE_VERSION}-rc__${GITHUB_SHA}" >> $GITHUB_ENV
- name: Setup project
run: pnpm run setup
- name: Build extension for ${{ matrix.extension_type }}
run: |
if [ "${{ matrix.extension_type }}" = "firefox" ]; then
echo "Building extension using manifest v2"
MANIFEST_VERSION=v2 pnpm run build:extension
else
echo "Building extension using manifest v3"
MANIFEST_VERSION=v3 pnpm run build:extension
fi
- name: Check bundle size for ${{ matrix.extension_type }}
run: pnpm check-bundle-size
- 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: Install zip
run: apt-get update && apt-get install -y zip
- 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
container:
image: mcr.microsoft.com/playwright:v1.48.2-jammy
needs: [build-all-artifacts]
environment: "hydrogen" # test-unit is always run against hydrogen
env:
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_X_ENVIRONMENT: "hydrogen"
FEATURE_MULTISIG: "true"
DEVNET_HOST: devnet
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: ${{ env.PNPM_VERSION }}
run_install: false
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "pnpm"
- name: Restore pnpm cache
uses: actions/cache/restore@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/restore@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/sonarcloud-github-action@v3.1.0
with:
projectBaseDir: ./packages/extension
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
test-e2e:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.48.2-jammy
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 }}
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 }}
E2E_MIG_ACCOUNT_ADDRESS: ${{ secrets.E2E_MIG_ACCOUNT_ADDRESS }}
E2E_ACCOUNT_TO_IMPORT_AND_TX: ${{ secrets.E2E_ACCOUNT_TO_IMPORT_AND_TX }}
E2E_ACCOUNTS_TO_IMPORT: ${{ secrets.E2E_ACCOUNTS_TO_IMPORT }}
E2E_QA_UTILS_AUTH_TOKEN: ${{ secrets.E2E_QA_UTILS_AUTH_TOKEN }}
E2E_QA_UTILS_URL: ${{ secrets.E2E_QA_UTILS_URL }}
E2E_MIG_VERSIONS: ${{ secrets.E2E_MIG_VERSIONS }}
E2E_EXTENSION_PASSWORD: ${{ secrets.E2E_EXTENSION_PASSWORD }}
# Refresh intervals
REFRESH_INTERVAL_FAST: 20 # 1s
REFRESH_INTERVAL_MEDIUM: 20 # 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: ${{ env.PNPM_VERSION }}
run_install: false
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "pnpm"
- name: Restore pnpm cache
uses: actions/cache/restore@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/restore@v4
with:
path: ./*
key: ${{ github.sha }}-chrome-${{ env.ARGENT_X_ENVIRONMENT }} # test-e2e is always run against chrome-hydrogen build
- name: Run e2e tests
run: xvfb-run --auto-servernum pnpm test:e2e --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
container:
image: mcr.microsoft.com/playwright:v1.48.2-jammy
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 }}
E2E_MAINNET_SEED1: ${{ secrets.E2E_MAINNET_SEED1 }}
## BANK ACCOUNT, USED FOR FUND OTHER ACCOUNTS
E2E_SENDER_SEED: ${{ secrets.E2E_SENDER_SEED }}
E2E_EXTENSION_PASSWORD: ${{ secrets.E2E_EXTENSION_PASSWORD }}
# Refresh intervals
REFRESH_INTERVAL_FAST: 20 # 20s
REFRESH_INTERVAL_MEDIUM: 20 # 20s
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: ${{ env.PNPM_VERSION }}
run_install: false
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "pnpm"
- name: Restore pnpm cache
uses: actions/cache/restore@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/restore@v4
with:
path: ./*
key: ${{ github.sha }}-chrome-${{ env.ARGENT_X_ENVIRONMENT }}
- name: Run e2e prod tests
run: xvfb-run --auto-servernum pnpm test:e2e:mainnet --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
container:
image: mcr.microsoft.com/playwright:v1.48.2-jammy
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 }}
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 }}
E2E_MIG_ACCOUNT_ADDRESS: ${{ secrets.E2E_MIG_ACCOUNT_ADDRESS }}
E2E_ACCOUNT_TO_IMPORT_AND_TX: ${{ secrets.E2E_ACCOUNT_TO_IMPORT_AND_TX }}
E2E_ACCOUNTS_TO_IMPORT: ${{ secrets.E2E_ACCOUNTS_TO_IMPORT }}
E2E_QA_UTILS_AUTH_TOKEN: ${{ secrets.E2E_QA_UTILS_AUTH_TOKEN }}
E2E_QA_UTILS_URL: ${{ secrets.E2E_QA_UTILS_URL }}
INITIAL_BALANCE_MULTIPLIER: ${{ secrets.INITIAL_BALANCE_MULTIPLIER }}
E2E_MIG_VERSIONS: ${{ secrets.E2E_MIG_VERSIONS }}
E2E_EXTENSION_PASSWORD: ${{ secrets.E2E_EXTENSION_PASSWORD }}
# Refresh intervals
REFRESH_INTERVAL_FAST: 20 # 1s
REFRESH_INTERVAL_MEDIUM: 20 # 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: ${{ env.PNPM_VERSION }}
run_install: false
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "pnpm"
- name: Restore pnpm cache
uses: actions/cache/restore@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/restore@v4
with:
path: ./*
key: ${{ github.sha }}-chrome-${{ env.ARGENT_X_ENVIRONMENT }}
- name: Run e2e tx tests
run: xvfb-run --auto-servernum pnpm test:e2e: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:
E2E_QA_UTILS_AUTH_TOKEN: ${{ secrets.E2E_QA_UTILS_AUTH_TOKEN }}
E2E_QA_UTILS_URL: ${{ secrets.E2E_QA_UTILS_URL }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Slack notifications
run: node packages/e2e/src/utils/slackNotif.js
merge-reports:
needs: [test-e2e, test-e2e-prod, test-e2e-tx]
if: always()
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.48.2-jammy
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: ${{ env.PNPM_VERSION }}
run_install: false
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "pnpm"
- name: Restore pnpm cache
uses: actions/cache/restore@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]'
needs: [build-all-artifacts, test-unit, test-e2e, test-e2e-prod]
steps:
- name: Comment PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "[Builds for local testing](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
slack_notif:
runs-on: ubuntu-latest
if: always()
needs: [test-unit, test-e2e]
steps:
- name: Send notification to Slack
uses: 8398a7/action-slack@v3.16.2
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