Skip to content

Commit

Permalink
chore: ability to manually run Swift integration tests (#379)
Browse files Browse the repository at this point in the history
* chore: ability to manually run Swift integration tests

* fix: names
  • Loading branch information
chris13524 authored Feb 27, 2024
1 parent ef2d411 commit b43179b
Show file tree
Hide file tree
Showing 6 changed files with 217 additions and 101 deletions.
64 changes: 54 additions & 10 deletions .github/workflows/dispatch_validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
50 changes: 43 additions & 7 deletions .github/workflows/sub-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
Expand All @@ -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
30 changes: 30 additions & 0 deletions .github/workflows/sub-validate-health.yml
Original file line number Diff line number Diff line change
@@ -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 }}"
45 changes: 45 additions & 0 deletions .github/workflows/sub-validate-rust.yml
Original file line number Diff line number Diff line change
@@ -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 }}
45 changes: 45 additions & 0 deletions .github/workflows/sub-validate-swift.yml
Original file line number Diff line number Diff line change
@@ -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 }}
84 changes: 0 additions & 84 deletions .github/workflows/sub-validate.yml

This file was deleted.

0 comments on commit b43179b

Please sign in to comment.