Repository navigation
81 lines (80 loc) · 2.56 KB
/
Copy pathexamples.yaml
File metadata and controls
81 lines (80 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Examples
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
main:
name: Examples
runs-on: ubuntu-24.04
env:
CPM_SOURCE_CACHE: ${{ github.workspace }}/.cache/cpm
strategy:
fail-fast: false
matrix:
ydb-version: [25.1, trunk]
compiler: [clang, gcc]
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'
steps:
- name: Checkout PR
uses: actions/checkout@v4
if: github.event.pull_request.head.sha != ''
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Checkout
uses: actions/checkout@v4
if: github.event.pull_request.head.sha == ''
- name: Restore CPM sources
uses: actions/cache@v4
with:
path: .cache/cpm
key: cpm-ubuntu-24.04-${{ hashFiles('cmake/CPM.cmake', 'cmake/dependencies.cmake') }}
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: bash
run: |
echo "timestamp=$(date -u +%Y-%m-%d-%H-%M-%S)" >> "$GITHUB_OUTPUT"
- name: Restore cache files
uses: actions/cache@v4
with:
path: ~/.ccache
key: ubuntu-24.04-ccache-${{ matrix.compiler }}-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
ubuntu-24.04-ccache-${{ matrix.compiler }}-
- name: Install dependencies
uses: ./.github/actions/prepare_vm
- name: Build
uses: ./.github/actions/build
with:
compiler: ${{ matrix.compiler }}
- name: Launch basic example
shell: bash
run: |
cd build
examples/basic_example/basic_example -e localhost:2136 -d /local
if [ ${{ matrix.ydb-version }} == "trunk" ]; then
examples/basic_example/basic_example -e localhost:2135 -d /local -c /tmp/ydb_certs/ca.pem
fi
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