Reff_App_Test #679
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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Reference App QA - Production | |
on: | |
push: | |
branches: [ main ] | |
repository_dispatch: | |
types: | |
- Reff_App_Test | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [ 16.x ] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- name: Event Information | |
if: github.event.action == 'Reff_App_Test' | |
run: | | |
echo "Event '${{ github.event.action }}' received from '${{ github.event.client_payload.repository }}'" | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: npm install | |
- name: Compile contracts | |
env: | |
BLOCKCHAIN_PROVIDER_URL: ${{ secrets.BLOCKCHAIN_PROVIDER_URL_ETH }} | |
REGISTRY_CONTRACT_ADDRESS: ${{ secrets.REGISTRY_CONTRACT_ADDRESS_ETH }} | |
run: npm run compile | |
- name: Solidity Lint | |
run: npm run lint:sol | |
- name: JS Lint | |
run: npm run lint:ts | |
- name: Run coders examples | |
run: | |
npx hardhat run scripts/coders.ts | |
- name: Unit tests for BSC | |
if: ${{ always() }} | |
env: | |
BLOCKCHAIN_PROVIDER_URL: ${{ secrets.BLOCKCHAIN_PROVIDER_URL_BSC }} | |
REGISTRY_CONTRACT_ADDRESS: ${{ secrets.REGISTRY_CONTRACT_ADDRESS_BSC }} | |
run: npm run test | |
- name: Run API Client examples for BSC | |
if: ${{ always() }} | |
env: | |
BLOCKCHAIN_PROVIDER_URL: ${{ secrets.BLOCKCHAIN_PROVIDER_URL_BSC }} | |
REGISTRY_CONTRACT_ADDRESS: ${{ secrets.REGISTRY_CONTRACT_ADDRESS_BSC }} | |
API_BASE_URL: ${{ secrets.API_BASE_URL }} | |
API_KEY: ${{ secrets.API_KEY }} | |
CHAIN_ID: ${{ secrets.CHAIN_ID_BSC }} | |
run: npx hardhat run scripts/api-client.ts | |
- name: Run proof verification example for BSC | |
if: ${{ always() }} | |
env: | |
BLOCKCHAIN_PROVIDER_URL: ${{ secrets.BLOCKCHAIN_PROVIDER_URL_BSC }} | |
REGISTRY_CONTRACT_ADDRESS: ${{ secrets.REGISTRY_CONTRACT_ADDRESS_BSC }} | |
API_BASE_URL: ${{ secrets.API_BASE_URL }} | |
API_KEY: ${{ secrets.API_KEY }} | |
CHAIN_ID: ${{ secrets.CHAIN_ID_BSC }} | |
run: | |
npx hardhat run scripts/proof-verification.ts | |
- name: Run Passport example for BSC | |
if: ${{ always() }} | |
env: | |
BLOCKCHAIN_PROVIDER_URL: ${{ secrets.BLOCKCHAIN_PROVIDER_URL_BSC }} | |
REGISTRY_CONTRACT_ADDRESS: ${{ secrets.REGISTRY_CONTRACT_ADDRESS_BSC }} | |
run: | |
npx hardhat run scripts/Passport/DatumRegistry.ts | |
- name: Unit tests for ETH | |
if: ${{ always() }} | |
env: | |
BLOCKCHAIN_PROVIDER_URL: ${{ secrets.BLOCKCHAIN_PROVIDER_URL_ETH }} | |
REGISTRY_CONTRACT_ADDRESS: ${{ secrets.REGISTRY_CONTRACT_ADDRESS_ETH }} | |
run: npm run test | |
- name: Run API Client examples for ETH | |
if: ${{ always() }} | |
env: | |
BLOCKCHAIN_PROVIDER_URL: ${{ secrets.BLOCKCHAIN_PROVIDER_URL_ETH }} | |
REGISTRY_CONTRACT_ADDRESS: ${{ secrets.REGISTRY_CONTRACT_ADDRESS_ETH }} | |
API_BASE_URL: ${{ secrets.API_BASE_URL }} | |
API_KEY: ${{ secrets.API_KEY }} | |
CHAIN_ID: ${{ secrets.CHAIN_ID_ETH }} | |
run: npx hardhat run scripts/api-client.ts | |
- name: Run proof verification example for ETH | |
if: ${{ always() }} | |
env: | |
BLOCKCHAIN_PROVIDER_URL: ${{ secrets.BLOCKCHAIN_PROVIDER_URL_ETH }} | |
REGISTRY_CONTRACT_ADDRESS: ${{ secrets.REGISTRY_CONTRACT_ADDRESS_ETH }} | |
API_BASE_URL: ${{ secrets.API_BASE_URL }} | |
API_KEY: ${{ secrets.API_KEY }} | |
CHAIN_ID: ${{ secrets.CHAIN_ID_ETH }} | |
run: npx hardhat run scripts/proof-verification.ts | |
- name: Unit tests for POLYGON | |
if: ${{ always() }} | |
env: | |
BLOCKCHAIN_PROVIDER_URL: ${{ secrets.BLOCKCHAIN_PROVIDER_URL_POLYGON }} | |
REGISTRY_CONTRACT_ADDRESS: ${{ secrets.REGISTRY_CONTRACT_ADDRESS_POLYGON }} | |
run: npm run test | |
- name: Run API Client examples for POLYGON | |
if: ${{ always() }} | |
env: | |
BLOCKCHAIN_PROVIDER_URL: ${{ secrets.BLOCKCHAIN_PROVIDER_URL_POLYGON }} | |
REGISTRY_CONTRACT_ADDRESS: ${{ secrets.REGISTRY_CONTRACT_ADDRESS_POLYGON }} | |
API_BASE_URL: ${{ secrets.API_BASE_URL }} | |
API_KEY: ${{ secrets.API_KEY }} | |
CHAIN_ID: ${{ secrets.CHAIN_ID_POLYGON }} | |
run: npx hardhat run scripts/api-client.ts | |
- name: Run proof verification example for POLYGON | |
if: ${{ always() }} | |
env: | |
BLOCKCHAIN_PROVIDER_URL: ${{ secrets.BLOCKCHAIN_PROVIDER_URL_POLYGON }} | |
REGISTRY_CONTRACT_ADDRESS: ${{ secrets.REGISTRY_CONTRACT_ADDRESS_POLYGON }} | |
API_BASE_URL: ${{ secrets.API_BASE_URL }} | |
API_KEY: ${{ secrets.API_KEY }} | |
CHAIN_ID: ${{ secrets.CHAIN_ID_POLYGON }} | |
run: npx hardhat run scripts/proof-verification.ts | |
- name: Unit tests for AVAX | |
if: ${{ always() }} | |
env: | |
BLOCKCHAIN_PROVIDER_URL: ${{ secrets.BLOCKCHAIN_PROVIDER_URL_AVAX }} | |
REGISTRY_CONTRACT_ADDRESS: ${{ secrets.REGISTRY_CONTRACT_ADDRESS_AVAX }} | |
run: npm run test | |
- name: Run API Client examples for AVAX | |
if: ${{ always() }} | |
env: | |
BLOCKCHAIN_PROVIDER_URL: ${{ secrets.BLOCKCHAIN_PROVIDER_URL_AVAX }} | |
REGISTRY_CONTRACT_ADDRESS: ${{ secrets.REGISTRY_CONTRACT_ADDRESS_AVAX }} | |
API_BASE_URL: ${{ secrets.API_BASE_URL }} | |
API_KEY: ${{ secrets.API_KEY }} | |
CHAIN_ID: ${{ secrets.CHAIN_ID_AVAX }} | |
run: npx hardhat run scripts/api-client.ts | |
- name: Run proof verification example for AVAX | |
if: ${{ always() }} | |
env: | |
BLOCKCHAIN_PROVIDER_URL: ${{ secrets.BLOCKCHAIN_PROVIDER_URL_AVAX }} | |
REGISTRY_CONTRACT_ADDRESS: ${{ secrets.REGISTRY_CONTRACT_ADDRESS_AVAX }} | |
API_BASE_URL: ${{ secrets.API_BASE_URL }} | |
API_KEY: ${{ secrets.API_KEY }} | |
CHAIN_ID: ${{ secrets.CHAIN_ID_AVAX }} | |
run: npx hardhat run scripts/proof-verification.ts | |
- name: Unit tests for Arbitrum | |
if: ${{ always() }} | |
env: | |
BLOCKCHAIN_PROVIDER_URL: ${{ secrets.BLOCKCHAIN_PROVIDER_URL_ARBITRUM }} | |
REGISTRY_CONTRACT_ADDRESS: ${{ secrets.REGISTRY_CONTRACT_ADDRESS_ARBITRUM }} | |
run: npm run test | |
- name: Run API Client examples for Arbitrum | |
if: ${{ always() }} | |
env: | |
BLOCKCHAIN_PROVIDER_URL: ${{ secrets.BLOCKCHAIN_PROVIDER_URL_ARBITRUM }} | |
REGISTRY_CONTRACT_ADDRESS: ${{ secrets.REGISTRY_CONTRACT_ADDRESS_ARBITRUM }} | |
API_BASE_URL: ${{ secrets.API_BASE_URL }} | |
API_KEY: ${{ secrets.API_KEY }} | |
CHAIN_ID: ${{ secrets.CHAIN_ID_ARBITRUM }} | |
run: npx hardhat run scripts/api-client.ts | |
- name: Run proof verification example for Arbitrum | |
if: ${{ always() }} | |
env: | |
BLOCKCHAIN_PROVIDER_URL: ${{ secrets.BLOCKCHAIN_PROVIDER_URL_ARBITRUM }} | |
REGISTRY_CONTRACT_ADDRESS: ${{ secrets.REGISTRY_CONTRACT_ADDRESS_ARBITRUM }} | |
API_BASE_URL: ${{ secrets.API_BASE_URL }} | |
API_KEY: ${{ secrets.API_KEY }} | |
CHAIN_ID: ${{ secrets.CHAIN_ID_ARBITRUM }} | |
run: npx hardhat run scripts/proof-verification.ts | |
- name: Run API Client examples for Solana | |
if: ${{ always() }} | |
env: | |
API_BASE_URL: ${{ secrets.API_BASE_URL_SANDBOX }} | |
API_KEY: ${{ secrets.API_KEY_SANDBOX }} | |
ANCHOR_WALLET: ${{ secrets.SOLANA_WALLET }} | |
ANCHOR_PROVIDER_URL: ${{ secrets.BLOCKCHAIN_PROVIDER_URL_SOLANA }} | |
SOLANA_CHAIN_PROGRAM_ID: ${{ secrets.SOLANA_CHAIN_PROGRAM_ID }} | |
SOLANA_CALLER_PROGRAM_ID: ${{ secrets.SOLANA_CALLER_PROGRAM_ID }} | |
run: | |
echo $ANCHOR_WALLET > my_wallet.json; | |
ANCHOR_WALLET="./my_wallet.json" npx hardhat run ./scripts/solana_fetch_fcd.ts | |
notify: | |
name: Discord Notification | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
if: ${{ always() }} # You always want to be notified: success, failure, or cancelled | |
steps: | |
- name: Notify | |
uses: nobrayner/discord-webhook@v1 | |
with: | |
github-token: ${{ secrets.BOT_GITHUB_TOKEN }} | |
discord-webhook: ${{ secrets.DISCORD_PROD_WEBHOOK }} | |
title: '${{ github.workflow }}: {{STATUS}}' | |
description: '${{ github.event_name }} trigged this {{STATUS}}!' | |
# include-details: 'false' |