github.com/ydb-platform/ydb-go-sdk/v3@v3.89.2/.github/workflows/tests.yml (about)

     1  name: tests
     2  on:
     3    push:
     4      branches:
     5        - master
     6        - release-*
     7    pull_request:
     8    workflow_dispatch:
     9    # For detect flaky tests
    10    schedule:
    11      - cron: "45 * * * *"
    12  
    13  jobs:
    14    unit:
    15      if: (!contains(github.event.pull_request.labels.*.name, 'no tests'))
    16      concurrency:
    17        group: unit-${{ github.event_name }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.go-version }}
    18        cancel-in-progress: true
    19      strategy:
    20        fail-fast: false
    21        matrix:
    22          go-version: [1.21.x, 1.22.x, 1.23.x]
    23          os: [ubuntu, windows, macOS]
    24      env:
    25        OS: ${{ matrix.os }}-latest
    26        GO: ${{ matrix.go-version }}
    27      runs-on: ${{ matrix.os }}-latest
    28      steps:
    29        - name: Checkout code
    30          uses: actions/checkout@v4
    31        - name: Install Go
    32          uses: actions/setup-go@v5
    33          with:
    34            go-version: ${{ matrix.go-version }}
    35            cache: true
    36        - name: Run tests
    37          run: go test -race -coverprofile unit.txt -covermode atomic -v ./...
    38        - name: Upload unit-tests coverage report to Codecov
    39          uses: codecov/codecov-action@v4
    40          with:
    41            file: ./unit.txt
    42            flags: unit,${{ matrix.os }},go-${{ matrix.go-version }}
    43            name: unit
    44          env:
    45            CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
    46    integration:
    47      if: (!contains(github.event.pull_request.labels.*.name, 'no tests'))
    48      concurrency:
    49        group: integration-${{ github.event_name }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.go-version }}-${{ matrix.ydb-version }}
    50        cancel-in-progress: true
    51      runs-on: ${{ matrix.os }}-latest
    52      strategy:
    53        fail-fast: false
    54        matrix:
    55          go-version: [1.21.x, 1.22.x, 1.23.x]
    56          ydb-version: [23.3, 24.1, 24.2]
    57          os: [ubuntu]
    58      services:
    59        ydb:
    60          image: ydbplatform/local-ydb:${{ matrix.ydb-version }}
    61          ports:
    62            - 2135:2135
    63            - 2136:2136
    64            - 8765:8765
    65          volumes:
    66            - /tmp/ydb_certs:/ydb_certs
    67          env:
    68            YDB_LOCAL_SURVIVE_RESTART: true
    69            YDB_USE_IN_MEMORY_PDISKS: true
    70            YDB_TABLE_ENABLE_PREPARED_DDL: true
    71            YDB_ENABLE_COLUMN_TABLES: true
    72          options: '-h localhost'
    73      env:
    74        OS: ubuntu-latest
    75        GO: ${{ matrix.go-version }}
    76        YDB_VERSION: ${{ matrix.ydb-version }}
    77        YDB_CONNECTION_STRING: grpc://localhost:2136/local
    78        YDB_CONNECTION_STRING_SECURE: grpcs://localhost:2135/local
    79        YDB_SSL_ROOT_CERTIFICATES_FILE: /tmp/ydb_certs/ca.pem
    80        YDB_SESSIONS_SHUTDOWN_URLS: http://localhost:8765/actors/kqp_proxy?force_shutdown=all
    81        HIDE_APPLICATION_OUTPUT: 1
    82      steps:
    83        - name: Checkout code
    84          uses: actions/checkout@v4
    85        - name: Install Go
    86          uses: actions/setup-go@v5
    87          with:
    88            go-version: ${{ matrix.go-version }}
    89            cache: true
    90        - name: Run tests
    91          run: go test -race -tags integration -coverpkg=./... -coverprofile integration.txt -covermode atomic ./tests/integration
    92        - name: Upload integration-tests coverage report to Codecov
    93          uses: codecov/codecov-action@v4
    94          with:
    95            file: ./integration.txt
    96            flags: integration,${{ matrix.os }},go-${{ matrix.go-version }},ydb-${{ matrix.ydb-version }}
    97            name: integration
    98          env:
    99            CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
   100    experiment:
   101      if: (!contains(github.event.pull_request.labels.*.name, 'no tests'))
   102      concurrency:
   103        group: experiment-${{ github.event_name }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.go-version }}-${{ matrix.ydb-version }}
   104        cancel-in-progress: true
   105      runs-on: ${{ matrix.os }}-latest
   106      strategy:
   107        fail-fast: false
   108        matrix:
   109          go-version: [1.23.x]
   110          ydb-version: [nightly]
   111          os: [ubuntu]
   112      services:
   113        ydb:
   114          image: ydbplatform/local-ydb:${{ matrix.ydb-version }}
   115          ports:
   116            - 2135:2135
   117            - 2136:2136
   118            - 8765:8765
   119          volumes:
   120            - /tmp/ydb_certs:/ydb_certs
   121          env:
   122            YDB_LOCAL_SURVIVE_RESTART: true
   123            YDB_USE_IN_MEMORY_PDISKS: true
   124            YDB_TABLE_ENABLE_PREPARED_DDL: true
   125            YDB_FEATURE_FLAGS: enable_topic_service_tx
   126            YDB_ENABLE_COLUMN_TABLES: true
   127          options: '-h localhost'
   128      env:
   129        OS: ubuntu-latest
   130        GO: ${{ matrix.go-version }}
   131        YDB_VERSION: ${{ matrix.ydb-version }}
   132        YDB_CONNECTION_STRING: grpc://localhost:2136/local
   133        YDB_CONNECTION_STRING_SECURE: grpcs://localhost:2135/local
   134        YDB_SSL_ROOT_CERTIFICATES_FILE: /tmp/ydb_certs/ca.pem
   135        YDB_SESSIONS_SHUTDOWN_URLS: http://localhost:8765/actors/kqp_proxy?force_shutdown=all
   136        HIDE_APPLICATION_OUTPUT: 1
   137      steps:
   138        - name: Checkout code
   139          uses: actions/checkout@v4
   140        - name: Install Go
   141          uses: actions/setup-go@v5
   142          with:
   143            go-version: ${{ matrix.go-version }}
   144            cache: true
   145        - name: Run tests
   146          run: go test -race -tags integration -coverpkg=./... -coverprofile experiment.txt -covermode atomic ./...
   147        - name: Upload experimental-tests coverage report to Codecov
   148          uses: codecov/codecov-action@v4
   149          with:
   150            file: ./experiment.txt
   151            flags: experiment,${{ matrix.os }},go-${{ matrix.go-version }},ydb-${{ matrix.ydb-version }}
   152            name: experiment
   153          env:
   154            CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}