Skip to content

Base 0 commit

Base 0 commit #1

name: Integration Tests - Soak
on:
push:
branches:
- main
- develop
workflow_dispatch:
inputs:
cl_branch_ref:
description: Plugin repo branch to integrate with
required: true
default: develop
type: string
l2_rpc_url:
description: Override default RPC url which points to local devnet (Optional)
required: false
type: string
node_count:
description: Number of ocr nodes
required: true
default: 5
type: string
ttl:
description: TTL for namespace
required: true
default: 72h
type: string
# Only run 1 of this workflow at a time per PR
concurrency:
group: integration-tests-starknet-${{ github.ref }}
cancel-in-progress: true
env:
ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/plugin-starknet-tests:${{ github.sha }}
jobs:
build_custom_plugin_image:
name: Build Custom CL Image
runs-on: ubuntu-latest
environment: integration
permissions:
id-token: write
contents: read
steps:
- name: Check if image exists
id: check-image
uses: goplugin/plugin-github-actions/docker/image-exists@8489879838862929f43f7d7cd1b33903965cf507 # v2.1.6
with:
repository: plugin
tag: starknet.${{ github.sha }}
AWS_REGION: ${{ secrets.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
- name: Build Image
if: steps.check-image.outputs.exists == 'false'
# note using a temporary commit for build-image that works around the go get issues, replace when go get issues are fixed please
uses: goplugin/plugin-github-actions/plugin-testing-framework/build-image@a2bf54158aa0a77a55f432347bc9ecf8ef642c2b # cosmos_one_off
with:
cl_repo: goplugin/pluginv3.0
# By default we are integrating with CL develop
cl_ref: ${{ github.event.inputs.cl_branch_ref }}
# commit of the caller branch
dep_starknet_sha: ${{ github.event.pull_request.head.sha || github.sha }}
push_tag: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/plugin:starknet.${{ github.sha }}
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_PRIVATE_GHA_PULL: ${{ secrets.QA_PRIVATE_GHA_PULL }}
- name: Print Plugin Image Built
run: |
echo "### plugin image tag used for this test run :link:" >>$GITHUB_STEP_SUMMARY
echo "\`starknet.${{ github.sha }}\`" >>$GITHUB_STEP_SUMMARY
run_tests:
name: Run Soak Tests
runs-on: ubuntu-latest
needs: [ build_custom_plugin_image ]
environment: integration
env:
PLUGIN_ENV_USER: ${{ github.actor }}
L2_RPC_URL: ${{ github.event.inputs.l2_rpc_url }}
NODE_COUNT: ${{ github.event.inputs.node_count }}
PRIVATE_KEY: ${{ secrets.GOERLI_PRIVATE_KEY }}
ACCOUNT: ${{ secrets.GOERLI_ACCOUNT }}
TTL: ${{ github.event.inputs.ttl }}
DETACH_RUNNER: true
TEST_SUITE: soak
TEST_ARGS: -test.timeout ${{ github.event.inputs.ttl }}
TEST_LOG_LEVEL: debug
permissions:
checks: write
pull-requests: write
id-token: write
contents: read
steps:
- name: Checkout the repo
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Install Nix
uses: cachix/install-nix-action@29bd9290ef037a3ecbdafe83cbd2185e9dd0fa0a # v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Build Image
uses: ./.github/actions/build-test-image
with:
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ACCOUNT_NUMBER: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
- name: Run Tests
uses: goplugin/plugin-github-actions/plugin-testing-framework/run-tests@ce87f8986ca18336cc5015df75916c2ec0a7c4b3 # v2.1.2
with:
test_command_to_run: nix develop -c make test-integration-soak-ci
test_download_vendor_packages_command: cd integration-tests && nix develop -c go mod download
cl_repo: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/plugin
cl_image_tag: starknet.${{ github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
go_mod_path: ./integration-tests/go.mod
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}