diff --git a/.github/workflows/dispatch_validate.yml b/.github/workflows/dispatch_validate.yml index eec92b78..33057de1 100644 --- a/.github/workflows/dispatch_validate.yml +++ b/.github/workflows/dispatch_validate.yml @@ -13,13 +13,23 @@ on: default: true required: true type: boolean - check-staging: - description: "Validate Staging" + check-staging-rust: + description: "Validate Staging Rust" default: false required: true type: boolean - check-prod: - description: "Validate Prod" + check-prod-rust: + description: "Validate Prod Rust" + default: false + required: true + type: boolean + check-staging-swift: + description: "Validate Staging Swift" + default: false + required: true + type: boolean + check-prod-swift: + description: "Validate Prod Swift" default: false required: true type: boolean @@ -38,20 +48,54 @@ jobs: check-infra: ${{ inputs.check-infra }} check-app: ${{ inputs.check-app }} - validate-staging: - name: Validate - Staging + validate-staging-health: + name: Validate - Staging - Health + uses: ./.github/workflows/sub-validate-health.yml + secrets: inherit + with: + stage: staging + stage-url: https://staging.${{ vars.SUBDOMAIN_NAME }}.walletconnect.com/health + + validate-prod-health: + name: Validate - Prod - Health + uses: ./.github/workflows/sub-validate-health.yml + secrets: inherit + with: + stage: prod + stage-url: https://${{ vars.SUBDOMAIN_NAME }}.walletconnect.com/health + + validate-staging-rust: + name: Validate - Staging - Rust if: ${{ inputs.check-staging }} - uses: ./.github/workflows/sub-validate.yml + uses: ./.github/workflows/sub-validate-rust.yml secrets: inherit with: stage: staging stage-url: https://staging.${{ vars.SUBDOMAIN_NAME }}.walletconnect.com/health - validate-prod: - name: Validate - Prod + validate-prod-rust: + name: Validate - Prod - Rust if: ${{ inputs.check-prod }} - uses: ./.github/workflows/sub-validate.yml + uses: ./.github/workflows/sub-validate-rust.yml secrets: inherit with: stage: prod + stage-url: https://${{ vars.SUBDOMAIN_NAME }}.walletconnect.com/health + + validate-staging-swift: + name: Validate - Staging - Swift + if: ${{ inputs.check-staging }} + uses: ./.github/workflows/sub-validate-swift.yml + secrets: inherit + with: + stage: staging stage-url: https://staging.${{ vars.SUBDOMAIN_NAME }}.walletconnect.com/health + + validate-prod-swift: + name: Validate - Prod - Swift + if: ${{ inputs.check-prod }} + uses: ./.github/workflows/sub-validate-swift.yml + secrets: inherit + with: + stage: prod + stage-url: https://${{ vars.SUBDOMAIN_NAME }}.walletconnect.com/health diff --git a/.github/workflows/sub-cd.yml b/.github/workflows/sub-cd.yml index 6d94ab6f..0b95ada8 100644 --- a/.github/workflows/sub-cd.yml +++ b/.github/workflows/sub-cd.yml @@ -42,18 +42,36 @@ jobs: ofac-blocked-zones: ${{ vars.OFAC_BLOCKED_ZONES }} aws-role-arn: ${{ vars.AWS_ROLE_STAGING }} - validate-staging: - name: Validate Staging + validate-staging-health: + name: Validate Staging Health needs: [ cd-staging ] - uses: ./.github/workflows/sub-validate.yml + uses: ./.github/workflows/sub-validate-health.yml secrets: inherit with: stage: staging stage-url: https://staging.${{ vars.SUBDOMAIN_NAME }}.walletconnect.com/health + validate-staging-rust: + name: Validate Staging Rust + needs: [ cd-staging ] + uses: ./.github/workflows/sub-validate-rust.yml + secrets: inherit + with: + stage: staging + stage-url: https://staging.${{ vars.SUBDOMAIN_NAME }}.walletconnect.com/health + + # validate-staging-swift: + # name: Validate Staging Swift + # needs: [ cd-staging ] + # uses: ./.github/workflows/sub-validate-swift.yml + # secrets: inherit + # with: + # stage: staging + # stage-url: https://staging.${{ vars.SUBDOMAIN_NAME }}.walletconnect.com/health + cd-prod: name: Prod - needs: [ validate-staging ] + needs: [ validate-staging-health, validate-staging-rust ] if: ${{ inputs.deploy-prod }} secrets: inherit uses: WalletConnect/ci_workflows/.github/workflows/cd.yml@0.2.3 @@ -67,11 +85,29 @@ jobs: ofac-blocked-zones: ${{ vars.OFAC_BLOCKED_ZONES }} aws-role-arn: ${{ vars.AWS_ROLE_PROD }} - validate-prod: - name: Validate Prod + validate-prod-health: + name: Validate Prod Health needs: [ cd-prod ] - uses: ./.github/workflows/sub-validate.yml + uses: ./.github/workflows/sub-validate-health.yml secrets: inherit with: stage: prod stage-url: https://${{ vars.SUBDOMAIN_NAME }}.walletconnect.com/health + + validate-prod-rust: + name: Validate Prod Rust + needs: [ cd-prod ] + uses: ./.github/workflows/sub-validate-rust.yml + secrets: inherit + with: + stage: prod + stage-url: https://${{ vars.SUBDOMAIN_NAME }}.walletconnect.com/health + + # validate-prod-swift: + # name: Validate Prod Swift + # needs: [ cd-prod ] + # uses: ./.github/workflows/sub-validate-swift.yml + # secrets: inherit + # with: + # stage: prod + # stage-url: https://${{ vars.SUBDOMAIN_NAME }}.walletconnect.com/health diff --git a/.github/workflows/sub-validate-health.yml b/.github/workflows/sub-validate-health.yml new file mode 100644 index 00000000..e77240e2 --- /dev/null +++ b/.github/workflows/sub-validate-health.yml @@ -0,0 +1,30 @@ +name: ❖ Validate Rust + +on: + workflow_call: + inputs: + stage: + description: 'the environment to validate' + required: true + type: string + stage-url: + description: 'the URL of the environment' + required: true + type: string + +permissions: + contents: read + checks: write + id-token: write + +jobs: + health-check: + name: Health Check - ${{ inputs.stage }} + runs-on: + group: ${{ vars.RUN_GROUP }} + environment: + name: ${{ inputs.stage }} + url: ${{ inputs.stage-url }} + steps: + - name: health-check + run: curl "${{ inputs.stage-url }}" diff --git a/.github/workflows/sub-validate-rust.yml b/.github/workflows/sub-validate-rust.yml new file mode 100644 index 00000000..5ba9f636 --- /dev/null +++ b/.github/workflows/sub-validate-rust.yml @@ -0,0 +1,45 @@ +name: ❖ Validate Rust + +on: + workflow_call: + inputs: + stage: + description: 'the environment to validate' + required: true + type: string + stage-url: + description: 'the URL of the environment' + required: true + type: string + +permissions: + contents: read + checks: write + id-token: write + +jobs: + validate-rust: + name: Rust Deployment Tests - ${{ inputs.stage }} + runs-on: + group: ${{ vars.RUN_GROUP }} + environment: + name: ${{ inputs.stage }} + url: ${{ inputs.stage-url }} + steps: + - uses: actions/checkout@v3 + + - name: Convert test environment + id: get_test_env + env: + TEST_ENV: ${{ inputs.stage }} + run: | + echo "test_env=${TEST_ENV^^}" >> $GITHUB_OUTPUT + + - name: Run deployment tests + run: cargo test --test deployment + env: + RUST_BACKTRACE: true + ENVIRONMENT: ${{ steps.get_test_env.outputs.test_env }} + PROJECT_ID: ${{ secrets.PROJECT_ID }} + NOTIFY_PROJECT_ID: ${{ secrets.VALIDATION_NOTIFY_PROJECT_ID }} + NOTIFY_PROJECT_SECRET: ${{ secrets.VALIDATION_NOTIFY_PROJECT_SECRET }} diff --git a/.github/workflows/sub-validate-swift.yml b/.github/workflows/sub-validate-swift.yml new file mode 100644 index 00000000..36db44f8 --- /dev/null +++ b/.github/workflows/sub-validate-swift.yml @@ -0,0 +1,45 @@ +name: ❖ Validate + +on: + workflow_call: + inputs: + stage: + description: 'the environment to validate' + required: true + type: string + stage-url: + description: 'the URL of the environment' + required: true + type: string + +permissions: + contents: read + checks: write + id-token: write + +jobs: + validate-swift: + name: Swift Integration Tests - ${{ inputs.stage }} + runs-on: + group: apple-silicon + permissions: + contents: write + environment: + name: ${{ inputs.stage }} + url: ${{ inputs.stage-url }} + steps: + - uses: actions/checkout@v3 + with: + repository: WalletConnect/WalletConnectSwiftV2 + + - name: Run Notify Tests + uses: ./.github/actions/run_tests_without_building + with: + type: 'notify-tests' + notify-endpoint: ${{ vars.VALIDATION_NOTIFY_ENDPOINT }} + relay-endpoint: ${{ vars.VALIDATION_RELAY_ENDPOINT }} + explorer-endpoint: ${{ vars.VALIDATION_EXPLORER_ENDPOINT }} + project-id: ${{ secrets.VALIDATION_SWIFT_PROJECT_ID }} + gm-dapp-host: ${{ vars.VALIDATION_DAPP_DOMAIN }} + gm-dapp-project-id: ${{ secrets.VALIDATION_SWIFT_DAPP_PROJECT_ID }} + gm-dapp-project-secret: ${{ secrets.VALIDATION_SWIFT_DAPP_PROJECT_SECRET }} diff --git a/.github/workflows/sub-validate.yml b/.github/workflows/sub-validate.yml deleted file mode 100644 index 8ab894d4..00000000 --- a/.github/workflows/sub-validate.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: ❖ Validate - -on: - workflow_call: - inputs: - stage: - description: 'the environment to validate' - required: true - type: string - default: 'staging' - stage-url: - description: 'the URL of the environment' - required: true - type: string - default: https://${{ vars.SUBDOMAIN_NAME }}.walletconnect.com/health - -permissions: - contents: read - checks: write - id-token: write - -jobs: - health-check: - name: Health Check - ${{ inputs.stage }} - runs-on: - group: ${{ vars.RUN_GROUP }} - environment: - name: ${{ inputs.stage }} - url: ${{ inputs.stage-url }} - steps: - - name: health-check - run: curl "${{ inputs.stage-url }}" - - validate-rust: - name: Deployment Tests - ${{ inputs.stage }} - runs-on: - group: ${{ vars.RUN_GROUP }} - environment: - name: ${{ inputs.stage }} - url: ${{ inputs.stage-url }} - steps: - - uses: actions/checkout@v3 - - - name: Convert test environment - id: get_test_env - env: - TEST_ENV: ${{ inputs.stage }} - run: | - echo "test_env=${TEST_ENV^^}" >> $GITHUB_OUTPUT - - - name: Run deployment tests - run: cargo test --test deployment - env: - RUST_BACKTRACE: true - ENVIRONMENT: ${{ steps.get_test_env.outputs.test_env }} - PROJECT_ID: ${{ secrets.PROJECT_ID }} - NOTIFY_PROJECT_ID: ${{ secrets.VALIDATION_NOTIFY_PROJECT_ID }} - NOTIFY_PROJECT_SECRET: ${{ secrets.VALIDATION_NOTIFY_PROJECT_SECRET }} - - # validate-swift: - # name: Swift Integration Tests - ${{ inputs.stage }} - # runs-on: - # group: apple-silicon - # permissions: - # contents: write - # environment: - # name: ${{ inputs.stage }} - # url: ${{ inputs.stage-url }} - # steps: - # - uses: actions/checkout@v3 - # with: - # repository: WalletConnect/WalletConnectSwiftV2 - - # - name: Run Notify Tests - # uses: ./.github/actions/run_tests_without_building - # with: - # type: 'notify-tests' - # notify-endpoint: ${{ vars.VALIDATION_NOTIFY_ENDPOINT }} - # relay-endpoint: ${{ vars.VALIDATION_RELAY_ENDPOINT }} - # explorer-endpoint: ${{ vars.VALIDATION_EXPLORER_ENDPOINT }} - # project-id: ${{ secrets.VALIDATION_SWIFT_PROJECT_ID }} - # gm-dapp-host: ${{ vars.VALIDATION_DAPP_DOMAIN }} - # gm-dapp-project-id: ${{ secrets.VALIDATION_SWIFT_DAPP_PROJECT_ID }} - # gm-dapp-project-secret: ${{ secrets.VALIDATION_SWIFT_DAPP_PROJECT_SECRET }}