dApps tests (all dapps, custom) #2556
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: dApps tests | |
run-name: dApps tests (${{ inputs.dapps || 'all dapps'}}, ${{ inputs.network || 'terraform' }}) | |
on: | |
schedule: | |
- cron: "0 1 * * 6" | |
workflow_dispatch: | |
inputs: | |
network: | |
type: choice | |
default: terraform | |
required: true | |
description: "Stand name" | |
options: | |
- night-stand | |
- devnet | |
- terraform | |
- custom | |
dapps: | |
type: string | |
required: false | |
description: "List of dapps separated by commas (if empty, all will be run)" | |
proxy_url: | |
type: string | |
required: false | |
description: "proxy_url (fill only for custom stand)" | |
solana_url: | |
type: string | |
required: false | |
description: "solana_url (fill only for custom stand)" | |
faucet_url: | |
type: string | |
required: false | |
description: "faucet_url (fill only for custom stand)" | |
network_id: | |
type: string | |
required: false | |
description: "network_id (fill only for custom stand)" | |
pr_url_for_report: | |
type: string | |
required: false | |
description: "Url to send the report as comment for PR" | |
env: | |
NETWORK: ${{ inputs.network || 'terraform' }} | |
BUILD_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
DUMP_ENVS: True | |
ALL_DAPPS: "aave-v2,aave-v3,curve,uniswap-v2,uniswap-v3,saddle,yearn,robonomics,compound,curve-factory,pancake" | |
jobs: | |
prepare: | |
runs-on: ["self-hosted", "k8s-prod"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: hashicorp/setup-terraform@v3 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 16 | |
- name: Define dapps to run | |
id: dapps | |
run: | | |
if [[ "${{ inputs.dapps }}" != "" ]]; then | |
list=${{ inputs.dapps }} | |
else | |
list=${{env.ALL_DAPPS}} | |
fi; | |
echo "list=${list}" | |
echo "list=${list}" >> $GITHUB_OUTPUT | |
- name: "Prepare terraform stand" | |
if: ${{ env.NETWORK == 'terraform' }} | |
id: prepare_terraform | |
timeout-minutes: 15 | |
env: | |
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}} | |
AWS_DEFAULT_REGION: ${{secrets.AWS_DEFAULT_REGION}} | |
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} | |
HCLOUD_TOKEN: ${{secrets.HCLOUD_TOKEN}} | |
TFSTATE_BUCKET: ${{vars.TFSTATE_BUCKET}} | |
TFSTATE_KEY: ${{vars.TFSTATE_KEY_PREFIX}}-${{ github.run_number }} | |
TFSTATE_REGION: ${{vars.TFSTATE_REGION}} | |
uses: ./.github/actions/create-tf-stand | |
with: | |
ci_stands_key_hcloud: ${{ secrets.CI_STANDS_KEY_HCLOUD }} | |
- name: "Define outputs" | |
id: vars | |
uses: ./.github/actions/define-stand-env | |
with: | |
network: ${{ env.NETWORK }} | |
devnet_solana_url: ${{ secrets.SOLANA_URL }} | |
devnet_faucet_url: ${{ secrets.DEVNET_FAUCET_URL }} | |
proxy_ip: ${{ steps.prepare_terraform.outputs.proxy_ip }} | |
solana_ip: ${{ steps.prepare_terraform.outputs.solana_ip }} | |
proxy_url: ${{ inputs.proxy_url }} | |
solana_url: ${{ inputs.solana_url }} | |
faucet_url: ${{ inputs.faucet_url }} | |
network_id: ${{ inputs.network_id }} | |
outputs: | |
network: ${{ env.NETWORK }} | |
solana_url: ${{ steps.vars.outputs.solana_url }} | |
proxy_url: ${{ steps.vars.outputs.proxy_url }} | |
faucet_url: ${{ steps.vars.outputs.faucet_url }} | |
network_id: ${{ steps.vars.outputs.network_id }} | |
proxy_ip: ${{ steps.prepare_terraform.outputs.proxy_ip }} | |
solana_ip: ${{ steps.prepare_terraform.outputs.solana_ip }} | |
dapps: ${{ steps.dapps.outputs.list }} | |
dapps-tests: | |
needs: | |
- prepare | |
uses: ./.github/workflows/dapps_reusable.yml | |
secrets: inherit | |
with: | |
network: ${{ needs.prepare.outputs.network }} | |
dapps: ${{ needs.prepare.outputs.dapps }} | |
proxy_url: ${{ needs.prepare.outputs.proxy_url }} | |
solana_url: ${{ needs.prepare.outputs.solana_url }} | |
faucet_url: ${{ needs.prepare.outputs.faucet_url }} | |
network_id: ${{ needs.prepare.outputs.network_id }} | |
pr_url_for_report: ${{ inputs.pr_url_for_report }} | |
proxy_ip: ${{ needs.prepare.outputs.proxy_ip }} | |
solana_ip: ${{ needs.prepare.outputs.solana_ip }} | |
external_call: false | |
repo: "tests" | |
notify: | |
runs-on: ["self-hosted", "k8s-prod"] | |
needs: [ prepare, dapps-tests ] | |
if: failure() && github.ref_name == 'develop' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install python requirements | |
id: requirements | |
uses: ./.github/actions/python-requirements | |
- name: Notify on failure | |
id: notification | |
run: | | |
python3 ./clickfile.py send-notification \ | |
--network ${{ env.NETWORK }} \ | |
-u ${{ secrets.SLACK_QA_CHANNEL_URL }} \ | |
-b ${{ env.BUILD_URL }} \ | |
--test-group dapps | |
destroy: | |
runs-on: ["self-hosted", "k8s-prod"] | |
needs: [ prepare, dapps-tests ] | |
if: always() && needs.prepare.outputs.network == 'terraform' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: hashicorp/setup-terraform@v3 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 16 | |
- name: "Destroy stand" | |
env: | |
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}} | |
AWS_DEFAULT_REGION: ${{secrets.AWS_DEFAULT_REGION}} | |
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} | |
HCLOUD_TOKEN: ${{secrets.HCLOUD_TOKEN}} | |
TFSTATE_BUCKET: ${{vars.TFSTATE_BUCKET}} | |
TFSTATE_KEY: ${{vars.TFSTATE_KEY_PREFIX}}-${{ github.run_number }} | |
TFSTATE_REGION: ${{vars.TFSTATE_REGION}} | |
PROXY_IP: ${{ needs.prepare.outputs.proxy_ip }} | |
SOLANA_IP: ${{ needs.prepare.outputs.solana_ip }} | |
uses: ././.github/actions/destroy-tf-stand | |
with: | |
ci_stands_key_hcloud: ${{ secrets.CI_STANDS_KEY_HCLOUD }} | |
devnet_solana_url: ${{ secrets.SOLANA_URL }} |