From d91aa95ef14cd153a193e8faa56ccfd1f0769607 Mon Sep 17 00:00:00 2001 From: st-shchetinin Date: Tue, 23 Jul 2024 18:44:20 +0300 Subject: [PATCH] divided into different jobs --- .github/workflows/examples.yaml | 26 +++++++++++ .github/workflows/pr_check.yaml | 71 ---------------------------- .github/workflows/tests.yaml | 82 +++++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+), 71 deletions(-) create mode 100644 .github/workflows/examples.yaml delete mode 100644 .github/workflows/pr_check.yaml create mode 100644 .github/workflows/tests.yaml diff --git a/.github/workflows/examples.yaml b/.github/workflows/examples.yaml new file mode 100644 index 0000000000..39213790ac --- /dev/null +++ b/.github/workflows/examples.yaml @@ -0,0 +1,26 @@ +main: + name: Examples + runs-on: ubuntu-22.04 + services: + ydb: + image: ydbplatform/local-ydb:latest + ports: + - 2135:2135 + - 2136:2136 + - 8765:8765 + volumes: + - /tmp/ydb_certs:/ydb_certs + env: + YDB_LOCAL_SURVIVE_RESTART: true + YDB_USE_IN_MEMORY_PDISKS: true + YDB_TABLE_ENABLE_PREPARED_DDL: true + options: '-h localhost' + steps: + - name: Launch basic example + shell: bash + run: | + cd ../build + examples/basic_example/basic_example -e localhost:2136 -d /local -p /local/basic + examples/bulk_upsert_simple/bulk_upsert_simple -e localhost:2136 -d /local -p /local/bulk + examples/pagination/pagination -e localhost:2136 -d /local -p /local/pagination + examples/ttl/ttl -e localhost:2136 -d /local -p /local/ttl \ No newline at end of file diff --git a/.github/workflows/pr_check.yaml b/.github/workflows/pr_check.yaml deleted file mode 100644 index 973b2671fe..0000000000 --- a/.github/workflows/pr_check.yaml +++ /dev/null @@ -1,71 +0,0 @@ -name: PR-check - -on: - push: - branches: - - main - pull_request: - branches: - - main -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} - cancel-in-progress: true -jobs: - main: - name: PR check for YDB C++ SDK - runs-on: ubuntu-22.04 - services: - ydb: - image: ydbplatform/local-ydb:latest - ports: - - 2135:2135 - - 2136:2136 - - 8765:8765 - volumes: - - /tmp/ydb_certs:/ydb_certs - env: - YDB_LOCAL_SURVIVE_RESTART: true - YDB_USE_IN_MEMORY_PDISKS: true - YDB_TABLE_ENABLE_PREPARED_DDL: true - options: '-h localhost' - steps: - - name: Checkout PR - uses: actions/checkout@v3 - if: github.event.pull_request.head.sha != '' - with: - submodules: true - ref: ${{ github.event.pull_request.head.sha }} - - name: Checkout - uses: actions/checkout@v3 - if: github.event.pull_request.head.sha == '' - with: - submodules: true - - name: Install dependencies - uses: ./.github/actions/prepare_vm - - name: Prepare ccache timestamp - id: ccache_cache_timestamp - shell: cmake -P {0} - run: | - string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) - message("::set-output name=timestamp::${current_date}") - - name: Restore cache files - uses: actions/cache/restore@v4 - with: - path: ~/.ccache - key: ubuntu-22.04-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: | - ubuntu-22.04-ccache- - - name: Build - uses: ./.github/actions/build - - name: Test - shell: bash - run: | - ctest -j32 --preset release - - name: Launch basic example - shell: bash - run: | - cd ../build - examples/basic_example/basic_example -e localhost:2136 -d /local -p /local/basic - examples/bulk_upsert_simple/bulk_upsert_simple -e localhost:2136 -d /local -p /local/bulk - examples/pagination/pagination -e localhost:2136 -d /local -p /local/pagination - examples/ttl/ttl -e localhost:2136 -d /local -p /local/ttl diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000000..55417c1bb4 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,82 @@ +name: PR-check + +on: + push: + branches: + - main + pull_request: + branches: + - main +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true +jobs: + unit: + concurrency: + group: unit-${{ github.ref }}-${{ matrix.os }}-${{ matrix.go-version }} + cancel-in-progress: true + strategy: + fail-fast: false + matrix: + os: [ubuntu, macOS] + env: + OS: ${{ matrix.os }}-latest + runs-on: ${{ matrix.os }}-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Run tests + run: ctest -j32 --preset release-unit + - name: Upload unit-tests coverage report to Codecov + uses: codecov/codecov-action@v4 + with: + file: ./unit.txt + flags: unit,${{ matrix.os }},go-${{ matrix.go-version }} + name: unit + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + integration: + concurrency: + group: integration-${{ github.ref }}-${{ matrix.os }}-${{ matrix.go-version }}-${{ matrix.ydb-version }} + cancel-in-progress: true + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ydb-version: [23.3, 24.1] + services: + ydb: + image: ydbplatform/local-ydb:${{ matrix.ydb-version }} + ports: + - 2135:2135 + - 2136:2136 + - 8765:8765 + volumes: + - /tmp/ydb_certs:/ydb_certs + env: + YDB_LOCAL_SURVIVE_RESTART: true + YDB_USE_IN_MEMORY_PDISKS: true + YDB_TABLE_ENABLE_PREPARED_DDL: true + options: '-h localhost' + env: + OS: ubuntu-latest + YDB_VERSION: ${{ matrix.ydb-version }} + YDB_CONNECTION_STRING: grpc://localhost:2136/local + YDB_CONNECTION_STRING_SECURE: grpcs://localhost:2135/local + YDB_SSL_ROOT_CERTIFICATES_FILE: /tmp/ydb_certs/ca.pem + YDB_SESSIONS_SHUTDOWN_URLS: http://localhost:8765/actors/kqp_proxy?force_shutdown=all + HIDE_APPLICATION_OUTPUT: 1 + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Run tests + run: ctest -j32 --preset release-integration + - name: Upload integration-tests coverage report to Codecov + uses: codecov/codecov-action@v4 + with: + file: ./integration.txt + flags: integration,${{ matrix.os }},go-${{ matrix.go-version }},ydb-${{ matrix.ydb-version }} + name: integration + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}