Skip to content

Commit

Permalink
crib ccip integration-tests workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
scheibinger committed Jan 21, 2025
1 parent 6f04719 commit 15e832d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 91 deletions.
16 changes: 13 additions & 3 deletions .github/actions/crib/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ inputs:
gap-url-integration-tests:
description: "GAP URL for integration tests"
required: true
crib-product-dir:
default: "chainlink"
description: "Product directory under crib deployments folder"
required: false
crib-command:
default: "core"
description: "The devspace command to run."
required: false
crib-alert-slack-webhook:
description: "CRIB alert Slack webhook"
required: true
Expand Down Expand Up @@ -111,8 +119,8 @@ runs:
aws-region: ${{ inputs.aws-region }}
aws-role-duration-seconds: "1800"

- name: Deploy and validate CRIB Environment for Core
uses: smartcontractkit/.github/actions/crib-deploy-environment@265e28cc322771651688493303785323e3482b15 # crib-deploy-environment@8.2.1
- name: Deploy and validate CRIB Environment for ${{ inputs.crib-product-dir }}
uses: smartcontractkit/.github/actions/crib-deploy-environment@d7521ea9bcaa8a022a3244221d6294bca79649ac # crib-deploy-environment@8.3.0
id: deploy-crib
with:
github-token: ${{ steps.token.outputs.access-token }}
Expand All @@ -123,14 +131,16 @@ runs:
k8s-cluster-name: ${{ inputs.k8s-cluster-name }}
chainlink-team: releng
chainlink-product: crib
command: "core-dev-simulated-core-ocr1"
product-dir: ${{ inputs.crib-product-dir }}
command: ${{ inputs.crib-command }}
crib-alert-slack-webhook: ${{ inputs.crib-alert-slack-webhook }}
product-image: ${{ inputs.crib-chainlink-docker-image-name }}
product-image-tag: ${{ inputs.crib-chainlink-docker-image-tag }}
ns-ttl: ${{ inputs.crib-cleanup-ttl }}
main-dns-zone: ${{ inputs.main-dns-zone }}

- name: Set up Go
if: inputs.integration-tests-run == 'true'
uses: ./.github/actions/setup-go
with:
go-version-file: "go.mod"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ jobs:
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID_PROD }}
api-gw-host-crib: ${{ secrets.AWS_API_GW_HOST_CRIB_STAGE }}
api-gw-host-k8s: ${{ secrets.AWS_API_GW_HOST_K8S_STAGE }}
k8s-api-endpoint: ${{ secrets.GAP_HOST_K8S_STAGE }}
k8s-cluster-name: ${{ secrets.AWS_K8S_CLUSTER_NAME_STAGE }}
aws-token-issuer-role-arn: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }}
aws-token-issuer-lambda-url: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }}
ingress-base-domain: ${{ secrets.INGRESS_BASE_DOMAIN_STAGE }}
k8s-staging-ingress-suffix: ${{ secrets.K8S_STAGING_INGRESS_SUFFIX }}
gap-url-integration-tests: ${{ secrets.GAP_URL }}
crib-command: 'core-dev-simulated-core-ocr1'
crib-alert-slack-webhook: ${{ secrets.CRIB_ALERT_SLACK_WEBHOOK }}
crib-chainlink-docker-image-name: ${{ format('{0}/{1}', env.ECR_HOSTNAME, needs.checks.outputs.ecr-image-name) }}
crib-chainlink-docker-image-tag: ${{ needs.build-sign-publish-chainlink.outputs.docker-image-tag}}
Expand Down
108 changes: 21 additions & 87 deletions .github/workflows/crib-ccip-v2-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ on:
pull_request:
paths:
- ".github/workflows/crib-ccip-v2-integration-test.yml"
schedule:
- cron: "0 1 * * *"
workflow_call:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -17,98 +21,28 @@ jobs:
contents: read
actions: read
steps:
- name: Prevent running on draft PRs
id: check-prereqs-for-running
run: |
should_run=true
if [ "${{ github.event_name }}" == "pull_request" ] && [ "${{ github.event.pull_request.draft }}" == "true" ]; then
should_run=false
fi
echo "should_run=$should_run" >> "$GITHUB_OUTPUT"
- name: Checkout repository
uses: actions/[email protected]

- uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
with:
nix_path: nixpkgs=channel:nixos-unstable
persist-credentials: false

- name: Setup GitHub token using GATI
id: token
uses: smartcontractkit/.github/actions/setup-github-token@c0b38e6c40d72d01b8d2f24f92623a2538b3dedb # main
- name: Run CRIB Integration Tests for CCIP
uses: ./.github/actions/crib
with:
aws-role-arn: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }}
aws-lambda-url: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }}
aws-region: ${{ secrets.AWS_REGION }}
aws-role-duration-seconds: "1800"
- name: Debug workspace dir
shell: bash
run: |
echo ${{ github.workspace }}
echo $GITHUB_WORKSPACE
- name: Deploy and validate CRIB Environment for CCIP v2
# if: steps.check-prereqs-for-running.outputs.should_run == 'true'
uses: smartcontractkit/.github/actions/crib-deploy-environment@57f99fbea73056c490c766d50ef582a13ec4f3bb # [email protected]
id: deploy-crib
with:
github-token: ${{ steps.token.outputs.access-token }}
aws-region: ${{ secrets.AWS_REGION }}
aws-role-arn: ${{ secrets.AWS_OIDC_CRIB_ROLE_ARN_STAGE }}
aws-ecr-private-registry: ${{ secrets.AWS_ACCOUNT_ID_PROD }}
ingress-base-domain: ${{ secrets.INGRESS_BASE_DOMAIN_STAGE }}
aws-region: ${{ secrets.AWS_REGION }}
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID_PROD }}
api-gw-host-crib: ${{ secrets.AWS_API_GW_HOST_CRIB_STAGE }}
api-gw-host-k8s: ${{ secrets.AWS_API_GW_HOST_K8S_STAGE }}
k8s-cluster-name: ${{ secrets.AWS_K8S_CLUSTER_NAME_STAGE }}
command: "deploy-geth"
aws-token-issuer-role-arn: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }}
aws-token-issuer-lambda-url: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }}
ingress-base-domain: ${{ secrets.INGRESS_BASE_DOMAIN_STAGE }}
k8s-staging-ingress-suffix: ${{ secrets.K8S_STAGING_INGRESS_SUFFIX }}
gap-url-integration-tests: ${{ secrets.GAP_URL }}
crib-product-dir: 'ccip-v2'
crib-command: 'ccip-v2-infra'
crib-alert-slack-webhook: ${{ secrets.CRIB_ALERT_SLACK_WEBHOOK }}
product-image: ${{ secrets.AWS_SDLC_ECR_HOSTNAME }}/ccip
product-image-tag: develop
product-dir: 'ccip-v2'
chainlink-team: ccip
chainlink-product: ccip
k8s-api-endpoint: ${{ secrets.K8S_API_ENDPOINT_STAGE }}
crib-repo-ref: 'crib-352/rpc-type'
- name: Get GH JWT Token
id: get-jwt-token
uses: actions/github-script@v7
with:
script: |
const audience = 'gap';
const id_token = await core.getIDToken(audience);
if (!id_token) {
throw new Error("Failed to retrieve the JWT token");
}
return id_token
- name: Test ws connection
env:
GETH_WS_ENDPOINT: wss://gap-${{ steps.deploy-crib.outputs.devspace-namespace }}-geth-1337-ws.public.main.stage.cldev.sh
shell: bash
run: |
set -xeuo pipefail
npm install -g wscat
echo "checking ws conection via gap"
wscat --no-check -c "${GETH_WS_ENDPOINT}" \
--header "x-authorization-github-jwt: Bearer ${{ steps.get-jwt-token.outputs.result }}" \
-x '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
echo "finished checking ws conection via gap"
# - uses: actions/[email protected]
# - name: Set up Go
# uses: ./.github/actions/setup-go
# with:
# go-version-file: 'go.mod'
# - name: Run CRIB integration test
# working-directory: integration-tests/crib
# env:
# K8S_STAGING_INGRESS_SUFFIX: ${{ secrets.K8S_STAGING_INGRESS_SUFFIX }}
# CRIB_NAMESPACE: ${{ steps.deploy-crib.outputs.devspace-namespace }}
# GAP_URL: ${{ secrets.GAP_URL }}
# run: |-
# # go test -v -run TestSomething
# echo "running tests here"
# - name: Destroy CRIB Environment
# id: destroy
# if: always() && steps.deploy-crib.outputs.devspace-namespace != ''
# uses: smartcontractkit/.github/actions/crib-purge-environment@c0b38e6c40d72d01b8d2f24f92623a2538b3dedb # [email protected]
# with:
# namespace: ${{ steps.deploy-crib.outputs.devspace-namespace }}
crib-chainlink-docker-image-name: ${{ secrets.AWS_SDLC_ECR_HOSTNAME }}/ccip
crib-chainlink-docker-image-tag: develop
main-dns-zone: ${{ secrets.MAIN_DNS_ZONE_PUBLIC_STAGE }}
1 change: 1 addition & 0 deletions .github/workflows/crib-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
ingress-base-domain: ${{ secrets.INGRESS_BASE_DOMAIN_STAGE }}
k8s-staging-ingress-suffix: ${{ secrets.K8S_STAGING_INGRESS_SUFFIX }}
gap-url-integration-tests: ${{ secrets.GAP_URL }}
crib-command: 'core-dev-simulated-core-ocr1'
crib-alert-slack-webhook: ${{ secrets.CRIB_ALERT_SLACK_WEBHOOK }}
crib-chainlink-docker-image-name: ${{ secrets.AWS_SDLC_ECR_HOSTNAME }}/chainlink
crib-chainlink-docker-image-tag: develop
Expand Down

0 comments on commit 15e832d

Please sign in to comment.