Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:neonlabsorg/neon-tests into NDEV…
Browse files Browse the repository at this point in the history
…-1774
  • Loading branch information
lyubenkov committed Dec 21, 2023
2 parents ca8f2d3 + a38d7b4 commit 91270cd
Show file tree
Hide file tree
Showing 138 changed files with 7,312 additions and 1,696 deletions.
38 changes: 38 additions & 0 deletions .github/actions/destroy-tf-stand/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Destroy stand"
description: "Destroy stand created by terraform"
inputs:
ci_stands_key_hcloud:
description: 'Private key for hcloud'
required: true
devnet_solana_url:
description: 'Solana url for devnet'
required: true
runs:
using: composite
steps:
- name: Install python requirements
if: always()
id: requirements
uses: ./.github/actions/python-requirements
- name: Prepare server for destroy terraform stand
if: always()
shell: bash
run: |
ssh_key=/tmp/ci-stands
echo "${{ inputs.ci_stands_key_hcloud }}" >> ${ssh_key} && chmod 400 ${ssh_key}
- name: Download docker logs
shell: bash
run: python3 ./clickfile.py infra download-logs
- name: Destroy stand with terraform
shell: bash
id: destroy
env:
TF_VAR_ci_pp_solana_url: ${{inputs.devnet_solana_url}}
if: always()
run: |
python3 ./clickfile.py infra destroy
- uses: actions/upload-artifact@v3
if: always()
with:
name: AWS docker logs
path: ./logs/*
8 changes: 4 additions & 4 deletions .github/actions/dockerize-neon-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ inputs:
description: 'branch name for oz tests'
required: true
default: master
version_tag:
description: 'neon-tests version tag'
branch_tag:
description: 'tag for feature or version branch'
required: false
default: ''
docker_username:
Expand All @@ -30,8 +30,8 @@ runs:
delimeter=$(printf "%0.s-" {1..30})
echo " ${delimeter} Build new docker image ${image_id} ${delimeter}"
docker build . --no-cache --tag ${image_id}:${{ inputs.image_tag }} --build-arg OZ_BRANCH='${{ inputs.oz_branch }}'
if [[ "${{ inputs.version_tag }}" != '' ]]; then
docker tag ${image_id}:${{ inputs.image_tag }} ${image_id}:${{ inputs.version_tag }}
if [[ "${{ inputs.branch_tag }}" != '' ]]; then
docker tag ${image_id}:${{ inputs.image_tag }} ${image_id}:${{ inputs.branch_tag }}
fi;
echo "${delimeter} Login into Docker registry as ${{ inputs.docker_username }} ${delimeter}"
echo "${{ inputs.docker_password }}" | docker login -u ${{ inputs.docker_username }} --password-stdin
Expand Down
120 changes: 120 additions & 0 deletions .github/actions/prepare-stand/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: "Prepare stand"
description: "Prepare environments for running tests and create terraform stand if it needed"
outputs:
solana_url:
description: "solana url"
value: ${{ steps.share.outputs.solana_url }}
proxy_url:
description: "proxy url"
value: ${{ steps.share.outputs.proxy_url }}
faucet_url:
description: "faucet url"
value: ${{ steps.share.outputs.faucet_url }}
network_id:
description: "network id"
value: ${{ steps.share.outputs.network_id }}
proxy_ip:
description: "proxy ip"
value: ${{ steps.share.outputs.proxy_ip }}
solana_ip:
description: "solana ip"
value: ${{ steps.share.outputs.solana_ip }}
inputs:
network:
description: 'Stand name'
required: true
ci_stands_key_hcloud:
description: 'Private key for hcloud'
required: false
devnet_solana_url:
description: 'Solana url for devnet'
required: false
tfstate_bucket:
description: 'Terraform state bucket'
required: false
tfstate_key_prefix:
description: 'Terraform state key prefix'
required: false
tfstate_region:
description: 'Terraform state region'
required: false
proxy_url:
description: 'Proxy url if network is custom'
required: false
faucet_url:
description: 'Faucet url if network is custom'
required: false
solana_url:
description: 'Solana url if network is custom'
required: false
network_id:
description: 'Network id if network is custom'
required: false
runs:
using: composite

steps:
- name: Install python requirements
id: requirements
uses: ./.github/actions/python-requirements
- name: Deploy stand with terraform
id: deploy
env:
TF_VAR_ci_pp_solana_url: ${{inputs.devnet_solana_url}}
shell: bash
if: inputs.network == 'terraform'
run: |
ssh_key='/tmp/ci-stands'
echo "${{ inputs.ci_stands_key_hcloud }}" >> ${ssh_key} && chmod 400 ${ssh_key}
python3 ./clickfile.py infra deploy
- uses: actions/upload-artifact@v3
if: inputs.network == 'terraform'
with:
name: tf-state
path: deploy/hetzner/

- name: Set outputs
id: share
env:
SOLANA_IP: ${{ env.SOLANA_IP }}
PROXY_IP: ${{ env.PROXY_IP }}
TFSTATE_BUCKET: ${{ inputs.tfstate_bucket }}
TFSTATE_KEY_PREFIX: ${{ inputs.tfstate_key_prefix }}
TFSTATE_REGION: ${{ inputs.tfstate_region }}
shell: bash
run: |
if [[ "${{inputs.network}}" == "custom" ]]; then
proxy_url=${{ inputs.proxy_url }}
faucet_url=${{ inputs.faucet_url }}
solana_url=${{ inputs.solana_url }}
network_id=${{ inputs.network_id }}
else
proxy_url=`python ./clickfile.py infra print-network-param -n '${{inputs.network}}' -p 'proxy_url'`
solana_url=`python ./clickfile.py infra print-network-param -n '${{inputs.network}}' -p 'solana_url'`
faucet_url=`python ./clickfile.py infra print-network-param -n '${{inputs.network}}' -p 'faucet_url'`
network_id=`python ./clickfile.py infra print-network-param -n '${{inputs.network}}' -p 'network_ids.neon'`
fi;
if [[ "${{ inputs.network }}" == "devnet" ]]; then
solana_url="${{ inputs.devnet_solana_url }}"
fi;
echo "proxy_url=$proxy_url"
echo "solana_url=$solana_url"
echo "faucet_url=$faucet_url"
echo "network_id=$network_id"
echo "solana_ip=${{ env.SOLANA_IP }}"
echo "proxy_ip=${{ env.PROXY_IP }}"
echo "proxy_url=$proxy_url" >> $GITHUB_OUTPUT
echo "solana_url=$solana_url" >> $GITHUB_OUTPUT
echo "faucet_url=$faucet_url" >> $GITHUB_OUTPUT
echo "network_id=$network_id" >> $GITHUB_OUTPUT
echo "proxy_ip=${{ env.PROXY_IP }}" >> $GITHUB_OUTPUT
echo "solana_ip=${{ env.SOLANA_IP }}" >> $GITHUB_OUTPUT
- name: Wait until proxy is ready
shell: bash
run: |
while [[ "$(curl -s -X POST -o /dev/null -w ''%{http_code}'' ${{ steps.share.outputs.proxy_url }})" != "200" ]];
do echo "Proxy is not ready yet. Waiting 5 seconds...";
sleep 5;
done
Loading

0 comments on commit 91270cd

Please sign in to comment.