Skip to content

tests

tests #1025

Workflow file for this run

name: 'tests'
on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- '**/*.md'
- 'README.md'
- 'CONTRIBUTING.md'
- 'LICENSE'
- '.static/**'
pull_request:
paths-ignore:
- '**/*.md'
- 'README.md'
- 'CONTRIBUTING.md'
- 'LICENSE'
- '.static/**'
schedule:
- cron: '0 9 * * *'
env:
GO_VERSION: "1.25"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Go & Proto
uses: ./.github/actions/setup-go-and-proto
with:
go-version: ${{ env.GO_VERSION }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version-file: ../.golangci-lint-version
working-directory: destination
args: --max-same-issues=1000
test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
clickhouse:
- "latest"
- "head"
permissions:
# IMPORTANT: this permission is mandatory for codecov-action
id-token: write
steps:
- uses: actions/checkout@v6
- name: Setup Go & Proto
uses: ./.github/actions/setup-go-and-proto
with:
go-version: ${{ env.GO_VERSION }}
- name: Start ClickHouse (version - ${{ matrix.clickhouse }}) in Docker
uses: hoverkraft-tech/compose-action@v2.5.0
env:
CLICKHOUSE_VERSION: ${{ matrix.clickhouse }}
with:
compose-file: 'docker-compose.ci.yml'
down-flags: '--volumes'
services: 'clickhouse'
- name: Add ClickHouse to /etc/hosts
run: |
sudo echo "127.0.0.1 clickhouse" | sudo tee -a /etc/hosts
- name: Run Go tests
run: |
make test-with-coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
use_oidc: true
files: cover.out
flags: test-local-${{ matrix.clickhouse }}
test-cloud:
# needs: [ "test" ]
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for codecov-action
id-token: write
steps:
- uses: actions/checkout@v6
- name: Setup Go & Proto
uses: ./.github/actions/setup-go-and-proto
with:
go-version: ${{ env.GO_VERSION }}
- name: Start ClickHouse in Docker (required to use clickhouse-client)
uses: hoverkraft-tech/compose-action@v2.5.0
env:
CLICKHOUSE_VERSION: latest
with:
compose-file: 'docker-compose.ci.yml'
down-flags: '--volumes'
services: 'clickhouse'
- name: Add ClickHouse to /etc/hosts
run: |
sudo echo "127.0.0.1 clickhouse" | sudo tee -a /etc/hosts
- name: Prepare ClickHouse Cloud JSON config
run: |
echo '{"host":"${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST_SMT }}","port":"9440","username":"default","password":"${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD_SMT }}"}' > ./sdk_tests/configuration.json
- name: Run Go tests
run: |
make test-with-coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
use_oidc: true
files: cover.out
flags: test-cloud