Bump clickhouse-connect from 0.6.20 to 0.7.0 #866
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: Build proxy docker image | |
on: | |
workflow_dispatch: | |
inputs: | |
test_set: | |
default: "basic" | |
required: true | |
neon_evm_commit: | |
required: false | |
neon_evm_branch: | |
required: false | |
initial_pr: | |
required: false | |
pull_request: | |
types: [opened, reopened, synchronize, labeled, unlabeled, ready_for_review] | |
push: | |
branches: | |
- master | |
- develop | |
- '[vt][0-9].[0-9]+.[0-9x]+*' | |
tags: | |
- "*" | |
env: | |
NEON_EVM_TAG: "latest" | |
FAUCET_TAG: "latest" | |
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}} | |
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}} | |
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} | |
BUILD_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
NEON_TEST_IMAGE: ${{vars.DOCKERHUB_ORG_NAME}}/neon_tests | |
TF_VAR_run_number: ${{ github.run_number }} | |
TF_VAR_ci_pp_solana_url: ${{secrets.DEVNET_INTERNAL_RPC}} | |
TF_VAR_proxy_model_commit: ${{github.sha}} | |
TF_VAR_neon_evm_commit: "latest" | |
TF_VAR_faucet_model_commit: ${{vars.FAUCET_COMMIT}} | |
TV_VAR_dockerhub_org_name: ${{vars.DOCKERHUB_ORG_NAME}} | |
HCLOUD_TOKEN: ${{secrets.HCLOUD_TOKEN}} | |
DOCKERHUB_ORG_NAME: ${{vars.DOCKERHUB_ORG_NAME}} | |
FAUCET_COMMIT: ${{vars.FAUCET_COMMIT}} | |
GH_ORG_NAME: ${{vars.GH_ORG_NAME}} | |
IMAGE_NAME: ${{vars.IMAGE_NAME}} | |
NEON_TEST_INVOKE_PROGRAM_IMAGE: ${{vars.NEON_TEST_INVOKE_PROGRAM_IMAGE}} | |
NEON_TEST_RUN_LINK: ${{vars.NEON_TEST_RUN_LINK}} | |
NEON_TESTS_ENDPOINT: ${{vars.NEON_TESTS_ENDPOINT}} | |
TFSTATE_BUCKET: ${{vars.TFSTATE_BUCKET}} | |
TFSTATE_KEY_PREFIX: ${{vars.TFSTATE_KEY_PREFIX}} | |
TFSTATE_REGION: ${{vars.TFSTATE_REGION}} | |
UNISWAP_V2_CORE_COMMIT: ${{vars.UNISWAP_V2_CORE_COMMIT}} | |
UNISWAP_V2_CORE_REPO: ${{vars.UNISWAP_V2_CORE_REPO}} | |
GITHUB_RUN_NUMBER: ${{ github.run_number }} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}${{ github.event.inputs.neon_evm_commit }} | |
cancel-in-progress: true | |
jobs: | |
build-image: | |
runs-on: build-runner | |
outputs: | |
proxy_tag: ${{ steps.tags.outputs.proxy }} | |
neon_evm_tag: ${{ steps.tags.outputs.neon_evm }} | |
is_version_proxy_branch: ${{ steps.is_version_proxy_branch.outputs.value }} | |
test_set: ${{ steps.test_set.outputs.value }} | |
neon_test_tag: ${{ steps.neon_test_final_tag.outputs.value }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: output branches name | |
run: | | |
echo "neon_evm_branch = ${{ github.event.inputs.neon_evm_branch }}" | |
echo "proxy_branch = ${{ github.ref }}" | |
- name: Check if proxy branch is version branch | |
id: is_version_proxy_branch | |
run: | | |
if [[ "${{ github.ref }}" =~ "refs/heads/"[vt][0-9]+\.[0-9]+\.x ]]; then | |
echo "value=true" | |
echo "value=true" >> $GITHUB_OUTPUT | |
else | |
echo "value=false" | |
echo "value=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Define images tags | |
id: tags | |
run: | | |
if [[ "${{ github.event.inputs.neon_evm_commit }}" != "" ]]; then | |
neon_evm_tag=${{ github.event.inputs.neon_evm_commit }} | |
else | |
neon_evm_tag="${NEON_EVM_TAG}" | |
fi; | |
echo "neon_evm_tag=${neon_evm_tag}" | |
echo "neon_evm=${neon_evm_tag}" >> $GITHUB_OUTPUT | |
if [[ "${{ github.event.inputs.neon_evm_commit }}" != "" ]]; then | |
evm_short_commit=`git rev-parse --short ${{ github.event.inputs.neon_evm_commit }}` | |
proxy_tag="${{ github.sha }}-${evm_short_commit}" | |
else | |
proxy_tag="${{ github.sha }}" | |
fi; | |
echo "proxy_tag=${proxy_tag}" | |
echo "proxy=$proxy_tag" >> $GITHUB_OUTPUT | |
- name: Define test set | |
id: test_set | |
run: | | |
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'extendedFullTestSuite') }}" == 'true' && "${{ github.event.pull_request.draft }}" == 'false' || "${{ github.event.inputs.test_set }}" == "extendedFullTestSuite" ]]; then | |
value="extendedFullTestSuite" | |
elif [[ "(${{ contains(github.event.pull_request.labels.*.name, 'fullTestSuite') }}" == 'true' && "${{ github.event.pull_request.draft }}" == 'false' || "${{ github.event.inputs.test_set }}" == "fullTestSuite" ]]; then | |
value="fullTestSuite" | |
else | |
value="basic" | |
fi; | |
echo "value=${value}" | |
echo "value=${value}" >> $GITHUB_OUTPUT | |
- name: Define test image tag | |
id: neon_test_tag | |
run: | | |
if ${{ steps.is_version_proxy_branch.outputs.value }}; then | |
tag=${GITHUB_REF/refs\/heads\//} | |
elif [[ $github_ref == *"refs/tags/"* ]]; then | |
tag=${GITHUB_REF/refs\/tags\//} | |
elif [[ "${{ github.base_ref }}" =~ "refs/heads/"[vt][0-9]+\.[0-9]+\.x ]]; then # pr to version branch | |
tag=${GITHUB_BASE_REF/refs\/heads\//} | |
elif [[ "${{ github.head_ref }}" != "" ]]; then # pr to feature branch | |
tag=${{ github.head_ref }} | |
elif [[ "${{ github.ref }}" =~ "refs/heads".+ ]] ; then # triggered by neon evm workflow | |
tag=${GITHUB_REF/refs\/heads\//} | |
else | |
tag='latest' | |
fi | |
echo "value=${tag}" | |
echo "value=${tag}" >> $GITHUB_OUTPUT | |
- name: Check image | |
id: test_image_exists | |
uses: cloudposse/github-action-docker-image-exists@main | |
continue-on-error: true | |
with: | |
registry: registry.hub.docker.com | |
organization: "neonlabsorg" | |
repository: "neon_tests" | |
login: ${{secrets.DOCKER_USERNAME}} | |
password: ${{secrets.DOCKER_PASSWORD}} | |
tag: ${{ steps.neon_test_tag.outputs.value}} | |
- name: Set latest tag for test image if feature/version branch doesn't exist | |
id: neon_test_final_tag | |
run: | | |
if [[ "${{ steps.test_image_exists.outcome }}" == "success" && "${{ github.ref_name }}" != "develop" ]]; then | |
tag=${{ steps.neon_test_tag.outputs.value}} | |
else | |
tag='latest' | |
fi | |
echo "value=${tag}" | |
echo "value=${tag}" >> $GITHUB_OUTPUT | |
- name: Build docker image | |
run: | | |
python3 ./.github/workflows/deploy.py build_docker_image \ | |
--neon_evm_tag=${{ steps.tags.outputs.neon_evm }} \ | |
--proxy_tag=${{ steps.tags.outputs.proxy }} \ | |
--head_ref_branch=${{ github.head_ref }} | |
- name: Publish image | |
run: | | |
python3 ./.github/workflows/deploy.py publish_image \ | |
--proxy_tag=${{ steps.tags.outputs.proxy }} | |
deploy-check: | |
needs: | |
- build-image | |
runs-on: test-runner | |
steps: | |
- uses: actions/checkout@v3 | |
- name: deploy_check | |
timeout-minutes: 60 | |
run: | | |
python3 ./.github/workflows/deploy.py deploy_check \ | |
--skip_uniswap \ | |
--proxy_tag=${{ needs.build-image.outputs.proxy_tag }} \ | |
--neon_evm_tag=${{ needs.build-image.outputs.neon_evm_tag }} \ | |
--faucet_tag=${{ env.FAUCET_TAG }} \ | |
--head_ref_branch=${{ github.head_ref }} \ | |
--github_ref_name=${{ github.ref_name }} | |
- name: Dump docker logs | |
if: always() | |
run: python3 ./.github/workflows/deploy.py dump_apps_logs --proxy_tag=${{ needs.build-image.outputs.proxy_tag }} | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: Docker logs | |
path: ./*.log | |
- name: Stop containers | |
if: always() | |
run: python3 ./.github/workflows/deploy.py stop_containers --proxy_tag=${{ needs.build-image.outputs.proxy_tag }} | |
prepare-infrastructure: | |
needs: | |
- build-image | |
if: | | |
contains(fromJSON('["extendedFullTestSuite", "fullTestSuite"]'), needs.build-image.outputs.test_set) || | |
(contains(github.event.pull_request.labels.*.name, 'FullTestSuite') && ! github.event.pull_request.draft) || | |
(github.ref_name =='develop' && !startsWith(github.event.inputs.neon_evm_branch , 'refs/pull')) || | |
github.ref_name =='master' || | |
startsWith(github.ref , 'refs/tags/') || | |
(needs.build-image.outputs.is_version_proxy_branch == 'true' && github.event.inputs.neon_evm_commit == '') | |
runs-on: test-runner | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Add private key | |
run: | | |
echo "${{ secrets.CI_STANDS_KEY_HCLOUD }}" > ${HOME}/.ssh/ci-stands | |
chmod 600 ${HOME}/.ssh/ci-stands | |
- name: Remove known_host | |
run: rm -f ${HOME}/.ssh/known_hosts | |
- name: Terraform build infra structure | |
id: terraform | |
run: | | |
python3 ./.github/workflows/deploy.py terraform_infrastructure \ | |
--dockerhub_org_name=${{ env.DOCKERHUB_ORG_NAME }} \ | |
--github_ref_name=${{ github.ref_name }} \ | |
--head_ref_branch=${{ github.head_ref }} \ | |
--neon_evm_tag=${{ needs.build-image.outputs.neon_evm_tag }} \ | |
--proxy_tag=${{ needs.build-image.outputs.proxy_tag }} \ | |
--faucet_tag=${{ env.FAUCET_TAG }} \ | |
--run_number=${{ env.GITHUB_RUN_NUMBER }} | |
- name: Set outputs | |
id: share | |
env: | |
SOLANA_IP: ${{ env.SOLANA_IP }} | |
PROXY_IP: ${{ env.PROXY_IP }} | |
run: | | |
echo "solana_ip=${{ env.SOLANA_IP }}" >> $GITHUB_OUTPUT | |
echo "proxy_ip=${{ env.PROXY_IP }}" >> $GITHUB_OUTPUT | |
outputs: | |
solana_ip: ${{ steps.share.outputs.solana_ip }} | |
proxy_ip: ${{ steps.share.outputs.proxy_ip }} | |
openzeppelin-tests: | |
if: ${{needs.prepare-infrastructure.result != 'skipped'}} | |
needs: | |
- prepare-infrastructure | |
- build-image | |
runs-on: test-runner | |
env: | |
SOLANA_IP: ${{ needs.prepare-infrastructure.outputs.solana_ip }} | |
PROXY_IP: ${{ needs.prepare-infrastructure.outputs.proxy_ip }} | |
CONTAINER: oz-${{ github.run_id }} | |
NETWORK_NAME: aws_custom | |
steps: | |
- name: Pull docker image | |
run: docker pull ${{ env.NEON_TEST_IMAGE }}:${{ needs.build-image.outputs.neon_test_tag }} | |
- name: Run docker container | |
run: | | |
docker run -i -e PROXY_IP=${{env.PROXY_IP}} \ | |
-e SOLANA_IP=${{env.SOLANA_IP}} \ | |
-e DUMP_ENVS=true \ | |
-e NETWORK_ID=111 \ | |
-e FAUCET_URL="http://${{env.PROXY_IP}}:3333/request_neon" \ | |
-e SOLANA_URL="http://${{env.SOLANA_IP}}:8899" \ | |
-e PROXY_URL="http://${{env.PROXY_IP}}:9090/solana" \ | |
-e NETWORK_NAME=${{env.NETWORK_NAME}} \ | |
-d --name=${{ env.CONTAINER }} ${{ env.NEON_TEST_IMAGE }} /bin/bash | |
- name: Run OpenZeppelin tests | |
run: | | |
docker exec -i ${{ env.CONTAINER }} python3 ./clickfile.py run oz \ | |
--network ${{ env.NETWORK_NAME }} \ | |
--jobs 8 \ | |
--users 10 | |
- name: Print OpenZeppelin report | |
run: | | |
docker exec -i ${{ env.CONTAINER }} python3 ./clickfile.py ozreport | |
- name: Analyze tests results | |
run: | | |
docker exec -i ${{ env.CONTAINER }} python3 ./clickfile.py analyze-openzeppelin-results | |
- name: "Archive report" | |
if: always() | |
run: | | |
docker exec -i ${{ env.CONTAINER }} tar -czvf ./allure-results.tar.gz /opt/neon-tests/allure-results | |
docker cp ${{ env.CONTAINER }}:/opt/neon-tests/allure-results.tar.gz ./ | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: FTS allure report | |
path: allure-results.tar.gz | |
- name: Remove docker container | |
if: always() | |
run: docker rm -f ${{ env.CONTAINER }} | |
basic-tests: | |
if: ${{needs.prepare-infrastructure.result != 'skipped'}} | |
needs: | |
- prepare-infrastructure | |
- build-image | |
runs-on: test-runner | |
env: | |
SOLANA_IP: ${{ needs.prepare-infrastructure.outputs.solana_ip }} | |
PROXY_IP: ${{ needs.prepare-infrastructure.outputs.proxy_ip }} | |
NUMPROCESSES: 4 | |
CONTAINER: basic-${{ github.run_id }} | |
NETWORK: aws | |
steps: | |
- name: Run docker container | |
run: | | |
image="${{ env.NEON_TEST_IMAGE }}:${{ needs.build-image.outputs.neon_test_tag }}" | |
docker pull $image | |
docker run -i -d -e PROXY_IP=${{ env.PROXY_IP }} -e SOLANA_IP=${{ env.SOLANA_IP }} \ | |
--name=${{ env.CONTAINER }} $image /bin/bash | |
- name: Update contracts in the container | |
run: | | |
docker exec -i ${{ env.CONTAINER }} \ | |
python3 ./clickfile.py update-contracts --branch ${{ github.head_ref || github.ref_name }} | |
- name: Run basic tests | |
run: | | |
docker exec -i ${{ env.CONTAINER }} \ | |
python3 ./clickfile.py run basic -n ${{ env.NETWORK }} --numprocesses ${{ env.NUMPROCESSES }} | |
- name: Remove docker container | |
if: always() | |
run: docker rm -f ${{ env.CONTAINER }} | |
dapps-tests: | |
needs: | |
- prepare-infrastructure | |
- build-image | |
runs-on: test-runner | |
env: | |
SOLANA_IP: ${{ needs.prepare-infrastructure.outputs.solana_ip }} | |
PROXY_IP: ${{ needs.prepare-infrastructure.outputs.proxy_ip }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Trigger dapps tests build | |
run: | | |
python3 ./.github/workflows/deploy.py trigger_dapps_tests \ | |
--solana_ip=${{env.SOLANA_IP}} \ | |
--proxy_ip=${{ env.PROXY_IP }} \ | |
--pr_url_for_report=${{github.event.inputs.initial_pr}} \ | |
--token=${{secrets.GHTOKEN}} \ | |
--test_set=${{needs.build-image.outputs.test_set }} | |
economy-tests: | |
if: needs.build-image.outputs.test_set=='extendedFullTestSuite' | |
needs: | |
- prepare-infrastructure | |
- dapps-tests | |
- basic-tests | |
- openzeppelin-tests | |
- build-image | |
runs-on: test-runner | |
env: | |
SOLANA_IP: ${{ needs.prepare-infrastructure.outputs.solana_ip }} | |
PROXY_IP: ${{ needs.prepare-infrastructure.outputs.proxy_ip }} | |
CONTAINER: economy-${{ github.run_id }} | |
NETWORK: aws | |
steps: | |
- name: Run docker container | |
run: | | |
image="${{ env.NEON_TEST_IMAGE }}:${{ needs.build-image.outputs.neon_test_tag }}" | |
docker pull $image | |
docker run -i -d -e PROXY_IP=${{ env.PROXY_IP }} -e SOLANA_IP=${{ env.SOLANA_IP }} \ | |
--name=${{ env.CONTAINER }} $image /bin/bash | |
- name: Run economy tests | |
run: | | |
docker exec -i ${{ env.CONTAINER }} \ | |
python3 ./clickfile.py run economy -n ${{ env.NETWORK }} | |
- name: Remove docker container | |
if: always() | |
run: docker rm -f ${{ env.CONTAINER }} | |
destroy-terraform: | |
needs: | |
- prepare-infrastructure | |
- openzeppelin-tests | |
- basic-tests | |
- dapps-tests | |
- economy-tests | |
- build-image | |
runs-on: test-runner | |
if: ${{always() && needs.prepare-infrastructure.result != 'skipped'}} | |
env: | |
SOLANA_IP: ${{ needs.prepare-infrastructure.outputs.solana_ip }} | |
PROXY_IP: ${{ needs.prepare-infrastructure.outputs.proxy_ip }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Add private key | |
run: | | |
echo "${{ secrets.CI_STANDS_KEY_HCLOUD }}" > ${HOME}/.ssh/ci-stands | |
chmod 644 ${HOME}/.ssh/ci-stands | |
- name: Get container logs | |
if: always() | |
run: python3 ./.github/workflows/deploy.py get_container_logs | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: FTS docker logs | |
path: ./logs/* | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: Terraform infrastructure logs | |
path: ./terraform.log | |
- name: Set output | |
id: vars | |
run: echo "bname=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | |
- name: Destroy terraform infrastructure | |
if: ${{always() && needs.prepare-infrastructure.result != 'skipped'}} | |
env: | |
TF_VAR_branch: ${{ steps.vars.outputs.bname }} | |
run: | | |
python3 ./.github/workflows/deploy.py destroy_terraform \ | |
--run_number=${{env.GITHUB_RUN_NUMBER}} \ | |
--proxy_tag=${{ needs.build-image.outputs.proxy_tag }} | |
finalize-image: | |
runs-on: build-runner | |
needs: | |
- build-image | |
- prepare-infrastructure | |
- openzeppelin-tests | |
- basic-tests | |
- dapps-tests | |
- economy-tests | |
- deploy-check | |
if: | | |
always() && | |
needs.deploy-check.result == 'success' && | |
((needs.openzeppelin-tests.result == 'success' && needs.basic-tests.result == 'success' | |
&& needs.dapps-tests.result == 'success' && contains(fromJSON('["success", "skipped"]'), needs.economy-tests.result)) || | |
needs.prepare-infrastructure.result == 'skipped') | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Tag published image | |
if: ${{ (github.event.inputs.neon_evm_commit == '' && | |
needs.build-image.outputs.is_version_proxy_branch == 'false') || | |
github.event.inputs.neon_evm_branch == 'refs/heads/develop' || | |
github.event.inputs.neon_evm_branch == 'refs/heads/master' }} | |
run: | | |
python3 ./.github/workflows/deploy.py finalize_image \ | |
--head_ref_branch=${{ github.head_ref }} \ | |
--github_ref=${GITHUB_REF} \ | |
--proxy_tag=${{ needs.build-image.outputs.proxy_tag }} | |
notification: | |
runs-on: build-runner | |
needs: | |
- finalize-image | |
- openzeppelin-tests | |
- basic-tests | |
- dapps-tests | |
- economy-tests | |
- deploy-check | |
- build-image | |
if: | | |
failure() && | |
(github.event.inputs.neon_evm_branch == 'refs/heads/develop' || | |
github.event.inputs.neon_evm_branch == 'refs/heads/master' || | |
(github.ref_name == 'develop' && github.event.inputs.neon_evm_commit == '') || | |
(github.ref_name == 'master' && github.event.inputs.neon_evm_commit == '') || | |
(needs.build-image.outputs.is_version_proxy_branch == 'true' && github.event.inputs.neon_evm_commit == '') || | |
startsWith(github.ref , 'refs/tags/')) | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Send notification to slack | |
run: | | |
python3 ./.github/workflows/deploy.py send_notification \ | |
--url=${{secrets.SLACK_PROXY_CHANNEL_URL}} \ | |
--build_url=${BUILD_URL} |