BLO-1632: update ramp sdk #202
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Userpage CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- develop | |
- main | |
pull_request: | |
branches: | |
- develop | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- environment: test | |
network: 3 | |
zksync: https://ropsten-beta-api.zksync.io/api/v0.2 | |
detector: "0xF230cF8980BaDA094720C01308319eF192F0F311" | |
multicall: "0x604D19Ba889A223693B0E78bC1269760B291b9Df" | |
- environment: staging | |
network: 1 | |
zksync: https://api.zksync.io/api/v0.2 | |
detector: "0xeca4B0bDBf7c55E9b7925919d03CbF8Dc82537E8" | |
multicall: "0xF34D2Cb31175a51B23fb6e08cA06d7208FaD379F" | |
- environment: production | |
network: 1 | |
zksync: https://api.zksync.io/api/v0.2 | |
detector: "0xeca4B0bDBf7c55E9b7925919d03CbF8Dc82537E8" | |
multicall: "0xF34D2Cb31175a51B23fb6e08cA06d7208FaD379F" | |
environment: ${{ matrix.environment }} | |
env: | |
REACT_APP_DESIRED_NETWORK_ID: ${{ matrix.network }} | |
REACT_APP_INFURA_KEY: ${{ secrets.INFURA_KEY }} | |
REACT_APP_ARGENT_API_ANS_WALLET_ENDPOINT: ${{ secrets.ARGENT_API_ANS_WALLET_ENDPOINT }} | |
REACT_APP_OPENSEA_API_KEY: ${{ secrets.OPENSEA_API_KEY }} | |
REACT_APP_RAMP_API_KEY: ${{ secrets.RAMP_API_KEY }} | |
REACT_APP_ZKSYNC_API_BASE: ${{ matrix.zksync }} | |
REACT_APP_ARGENT_DETECTOR_CONTRACT_ADDRESS: ${{ matrix.detector }} | |
REACT_APP_MULTICALL_CONTRACT_ADDRESS: ${{ matrix.multicall }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js 14 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 14 | |
cache: "yarn" | |
- run: yarn install | |
- run: yarn build:${{ matrix.environment }} | |
- name: Upload build | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build-${{ matrix.environment }} | |
path: build | |
test_unit: | |
runs-on: ubuntu-latest | |
environment: test | |
needs: build | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js 14 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 14 | |
cache: "yarn" | |
- run: yarn install | |
- run: yarn test:unit -u | |
test_int: | |
runs-on: ubuntu-latest | |
environment: test | |
needs: build | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js 14 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 14 | |
cache: "yarn" | |
- run: yarn install | |
- run: yarn test:int | |
test_e2e: | |
runs-on: ubuntu-latest | |
environment: test | |
needs: build | |
strategy: | |
matrix: | |
browser: | |
- chromium | |
- firefox | |
- webkit | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js 14 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 14 | |
cache: "yarn" | |
- name: Install Webkit deps | |
run: sudo apt-get update && sudo apt-get install -y libegl1 libopus0 libwoff1 libharfbuzz-icu0 gstreamer1.0-plugins-base libgstreamer-gl1.0-0 gstreamer1.0-plugins-bad libopenjp2-7 libwebpdemux2 libenchant1c2a libhyphen0 libgles2 gstreamer1.0-libav libevdev-tools | |
if: ${{ matrix.browser == 'webkit' }} | |
- run: yarn install | |
- uses: actions/download-artifact@v2 | |
with: | |
name: build-test | |
path: build | |
- run: yarn e2e:${{ matrix.browser }} | |
# deploy_preview: | |
# runs-on: ubuntu-latest | |
# needs: ["test_e2e", "test_unit", "test_int"] | |
# if: ${{ github.base_ref != '' }} | |
# steps: | |
# - uses: actions/download-artifact@v2 | |
# if: ${{ contains(github.base_ref, 'main') }} | |
# with: | |
# name: build-staging | |
# path: build | |
# - uses: actions/download-artifact@v2 | |
# if: ${{ contains(github.base_ref, 'develop') }} | |
# with: | |
# name: build-test | |
# path: build | |
# - uses: amondnet/vercel-action@v20 | |
# with: | |
# vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required | |
# github-token: ${{ secrets.GITHUB_TOKEN }} #Optional | |
# vercel-org-id: ${{ secrets.VERCEL_ORG_ID}} #Required | |
# vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} #Required | |
# working-directory: ./build | |
# deploy_s3: | |
# runs-on: ubuntu-latest | |
# needs: ["test_e2e", "test_unit", "test_int"] | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# environment: | |
# - test | |
# - staging | |
# environment: ${{ matrix.environment }} | |
# if: ${{ github.base_ref == '' }} | |
# env: | |
# S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }} | |
# CF_DISTRIBUTION_ID: ${{ secrets.CF_DISTRIBUTION_ID }} | |
# steps: | |
# - uses: actions/download-artifact@v2 | |
# with: | |
# name: build-${{ matrix.environment }} | |
# path: build | |
# - name: Configure AWS Credentials | |
# uses: aws-actions/configure-aws-credentials@v1 | |
# with: | |
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
# # aws-session-token: ${{ secrets.AWS_SESSION_TOKEN }} # if you have/need it | |
# aws-region: eu-west-1 | |
# - name: Deploy to S3 | |
# if: ${{ (matrix.environment == 'test' && contains(github.ref, 'develop')) || (matrix.environment == 'staging' && contains(github.ref, 'main')) }} | |
# run: aws s3 sync --acl public-read --sse --delete ./build s3://${{env.S3_BUCKET_NAME}} | |
# - name: Invalidate Cloudfront Cache | |
# if: ${{ (matrix.environment == 'test' && contains(github.ref, 'develop')) || (matrix.environment == 'staging' && contains(github.ref, 'main')) }} | |
# run: aws cloudfront create-invalidation --distribution-id ${{env.CF_DISTRIBUTION_ID}} --paths '/*' | |
# deploy_s3_prod: | |
# runs-on: ubuntu-latest | |
# needs: ["test_e2e", "test_unit", "test_int"] | |
# if: ${{ contains(github.ref, 'main') }} | |
# environment: production | |
# env: | |
# S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }} | |
# CF_DISTRIBUTION_ID: ${{ secrets.CF_DISTRIBUTION_ID }} | |
# steps: | |
# - uses: actions/download-artifact@v2 | |
# with: | |
# name: build-production | |
# path: build | |
# - name: Configure AWS Credentials | |
# uses: aws-actions/configure-aws-credentials@v1 | |
# with: | |
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
# # aws-session-token: ${{ secrets.AWS_SESSION_TOKEN }} # if you have/need it | |
# aws-region: eu-west-1 | |
# - name: Deploy to S3 | |
# run: aws s3 sync --acl public-read --sse --delete ./build s3://${{env.S3_BUCKET_NAME}} | |
# - name: Invalidate Cloudfront Cache | |
# run: aws cloudfront create-invalidation --distribution-id ${{env.CF_DISTRIBUTION_ID}} --paths '/*' | |
# dispatch_deploy: | |
# runs-on: ubuntu-latest | |
# if: ${{ !always() }} | |
# needs: ["test_e2e", "test_unit", "test_int"] | |
# steps: | |
# - name: Deploy Dispatch | |
# uses: peter-evans/repository-dispatch@v1 | |
# with: | |
# token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
# repository: argentlabs/argent-userpage-infra | |
# event-type: deploy | |
# client-payload: '{"repository": "${{ github.repository }}", "run_number": "${{ github.run_number }}"}' |