Skip to content

CI changes

CI changes #265

name: Tests cloud
permissions: write-all
on:
push:
branches:
- main
pull_request:
types: [opened, labeled, synchronize, reopened]
jobs:
test:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'tests:run-cloud'))
runs-on: [self-hosted, style-checker-aarch64]
defaults:
run:
shell: bash
strategy:
matrix:
go:
- "1.23"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go ${{ matrix.go }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_wrapper: false
- name: Create Cloud instance
id: create
working-directory: .github/cloud/
run: |
export TF_VAR_allowed_cidr="$(curl -s ifconfig.me)/32"
export TF_VAR_service_name="clickhouse-go $(git rev-parse --short HEAD) $(date +'%Y%m%d%H%M%S')"
terraform init
terraform validate
terraform apply -auto-approve -input=false -lock=false
terraform output
echo "CLICKHOUSE_HOST=$(terraform output -raw CLICKHOUSE_HOST)" >> $GITHUB_ENV
env:
TF_VAR_organization_id: ${{ secrets.INTEGRATIONS_TEAM_TESTS_ORGANIZATION_ID }}
TF_VAR_token_key: ${{ secrets.INTEGRATIONS_TEAM_TESTS_TOKEN_KEY }}
TF_VAR_token_secret: ${{ secrets.INTEGRATIONS_TEAM_TESTS_TOKEN_SECRET }}
TF_VAR_service_password: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD }}
TF_VAR_api_url: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_API_URL }}
- name: Tests
env:
CLICKHOUSE_PASSWORD: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD }}
CLICKHOUSE_USE_DOCKER: false
CLICKHOUSE_USE_SSL: true
TESTCONTAINERS_RYUK_DISABLED: "true"
run: |
CLICKHOUSE_DIAL_TIMEOUT=20 CLICKHOUSE_TEST_TIMEOUT=600s CLICKHOUSE_QUORUM_INSERT=2 make test
- name: Cleanup Cloud instance
if: always()
working-directory: .github/cloud/
run: |
terraform destroy -no-color -auto-approve -input=false -lock=false
env:
TF_VAR_organization_id: ${{ secrets.INTEGRATIONS_TEAM_TESTS_ORGANIZATION_ID }}
TF_VAR_token_key: ${{ secrets.INTEGRATIONS_TEAM_TESTS_TOKEN_KEY }}
TF_VAR_token_secret: ${{ secrets.INTEGRATIONS_TEAM_TESTS_TOKEN_SECRET }}
TF_VAR_service_password: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD }}
TF_VAR_api_url: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_API_URL }}