tests #1039
This file contains hidden or 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: '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 & Build | |
| uses: ./.github/actions/setup-go-and-build | |
| 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 & Build | |
| uses: ./.github/actions/setup-go-and-build | |
| 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 & Build | |
| uses: ./.github/actions/setup-go-and-build | |
| 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 |