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

     1  name: examples
     2  on:
     3    push:
     4      branches:
     5        - master
     6        - release-*
     7    pull_request:
     8    workflow_dispatch:
     9  jobs:
    10    basic-ydb:
    11      concurrency:
    12        group: basic-ydb-${{ github.ref }}-${{ matrix.ydb-version }}-${{ matrix.application }}
    13        cancel-in-progress: true
    14      runs-on: ubuntu-latest
    15      strategy:
    16        fail-fast: false
    17        matrix:
    18          ydb-version: [ 23.3, 24.1 ]
    19          application: [ native/table, native/query, database_sql, gorm, xorm ]
    20      services:
    21        ydb:
    22          image: ydbplatform/local-ydb:${{ matrix.ydb-version }}
    23          ports:
    24            - 2135:2135
    25            - 2136:2136
    26            - 8765:8765
    27          volumes:
    28            - /tmp/ydb_certs:/ydb_certs
    29          env:
    30            YDB_LOCAL_SURVIVE_RESTART: true
    31            YDB_USE_IN_MEMORY_PDISKS: true
    32            YDB_TABLE_ENABLE_PREPARED_DDL: true
    33          options: '-h localhost'
    34      env:
    35        OS: ubuntu-latest
    36        GO: 1.23.x
    37        YDB_CONNECTION_STRING: grpc://localhost:2136/local
    38        YDB_ANONYMOUS_CREDENTIALS: 1
    39        YDB_VERSION: ${{ matrix.ydb-version }}
    40      steps:
    41        - name: Checkout code
    42          uses: actions/checkout@v4
    43        - name: Install Go
    44          uses: actions/setup-go@v5
    45          with:
    46            cache: true
    47        - name: Run basic example ${{ matrix.application }}
    48          working-directory: ./examples/basic/${{ matrix.application }}
    49          run: go run .
    50    basic-postgres:
    51      concurrency:
    52        group: basic-postgres-${{ matrix.application }}-${{ github.ref }}
    53        cancel-in-progress: true
    54      runs-on: ubuntu-latest
    55      strategy:
    56        fail-fast: false
    57        matrix:
    58          application: [ gorm, xorm ]
    59      services:
    60        postgres:
    61          image: postgres
    62          env:
    63            POSTGRES_PASSWORD: postgres
    64            POSTGRES_DB: basic
    65          options: >-
    66            --health-cmd pg_isready
    67            --health-interval 5s
    68            --health-timeout 5s
    69            --health-retries 5
    70          ports:
    71            - 5432:5432
    72      env:
    73        OS: ubuntu-latest
    74        GO: 1.23.x
    75        POSTGRES_CONNECTION_STRING: postgres://postgres:postgres@localhost:5432/basic?sslmode=disable
    76      steps:
    77        - name: Checkout code
    78          uses: actions/checkout@v4
    79        - name: Install Go
    80          uses: actions/setup-go@v5
    81          with:
    82            cache: true
    83        - name: Run basic example ${{ matrix.application }} with postgres
    84          working-directory: ./examples/basic/${{ matrix.application }}
    85          run: go run .
    86    basic-sqlite:
    87      concurrency:
    88        group: basic-sqlite-${{ matrix.application }}-${{ github.ref }}
    89        cancel-in-progress: true
    90      runs-on: ubuntu-latest
    91      strategy:
    92        fail-fast: false
    93        matrix:
    94          application: [ gorm, xorm ]
    95      env:
    96        OS: ubuntu-latest
    97        GO: 1.23.x
    98        SQLITE_CONNECTION_STRING: ${{ matrix.application }}.db
    99      steps:
   100        - name: Checkout code
   101          uses: actions/checkout@v4
   102        - name: Install Go
   103          uses: actions/setup-go@v5
   104          with:
   105            cache: true
   106        - name: Run basic example ${{ matrix.application }} with sqlite
   107          working-directory: ./examples/basic/${{ matrix.application }}
   108          run: go run .