|
| 1 | +name: Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - main |
| 10 | +concurrency: |
| 11 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} |
| 12 | + cancel-in-progress: true |
| 13 | +jobs: |
| 14 | + unit: |
| 15 | + concurrency: |
| 16 | + group: unit-${{ github.ref }}-${{ matrix.os }} |
| 17 | + cancel-in-progress: true |
| 18 | + strategy: |
| 19 | + fail-fast: false |
| 20 | + env: |
| 21 | + OS: ubuntu-22.04 |
| 22 | + runs-on: ubuntu-22.04 |
| 23 | + steps: |
| 24 | + - name: Checkout PR |
| 25 | + uses: actions/checkout@v3 |
| 26 | + if: github.event.pull_request.head.sha != '' |
| 27 | + with: |
| 28 | + submodules: true |
| 29 | + ref: ${{ github.event.pull_request.head.sha }} |
| 30 | + - name: Checkout |
| 31 | + uses: actions/checkout@v3 |
| 32 | + if: github.event.pull_request.head.sha == '' |
| 33 | + with: |
| 34 | + submodules: true |
| 35 | + - name: Install dependencies |
| 36 | + uses: ./.github/actions/prepare_vm |
| 37 | + - name: Prepare ccache timestamp |
| 38 | + id: ccache_cache_timestamp |
| 39 | + shell: cmake -P {0} |
| 40 | + run: | |
| 41 | + string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) |
| 42 | + message("::set-output name=timestamp::${current_date}") |
| 43 | + - name: Restore cache files |
| 44 | + uses: actions/cache/restore@v4 |
| 45 | + with: |
| 46 | + path: ~/.ccache |
| 47 | + key: ubuntu-22.04-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} |
| 48 | + restore-keys: | |
| 49 | + ubuntu-22.04-ccache- |
| 50 | + - name: Build |
| 51 | + uses: ./.github/actions/build |
| 52 | + - name: Test |
| 53 | + shell: bash |
| 54 | + run: | |
| 55 | + ctest -j32 --preset release-unit |
| 56 | +
|
| 57 | + integration: |
| 58 | + concurrency: |
| 59 | + group: integration-${{ github.ref }}-${{ matrix.ydb-version }} |
| 60 | + cancel-in-progress: true |
| 61 | + runs-on: ubuntu-22.04 |
| 62 | + strategy: |
| 63 | + fail-fast: false |
| 64 | + matrix: |
| 65 | + ydb-version: [23.3, 24.1, trunk] |
| 66 | + services: |
| 67 | + ydb: |
| 68 | + image: ydbplatform/local-ydb:${{ matrix.ydb-version }} |
| 69 | + ports: |
| 70 | + - 2135:2135 |
| 71 | + - 2136:2136 |
| 72 | + - 8765:8765 |
| 73 | + volumes: |
| 74 | + - /tmp/ydb_certs:/ydb_certs |
| 75 | + env: |
| 76 | + YDB_LOCAL_SURVIVE_RESTART: true |
| 77 | + YDB_USE_IN_MEMORY_PDISKS: true |
| 78 | + YDB_TABLE_ENABLE_PREPARED_DDL: true |
| 79 | + options: '-h localhost' |
| 80 | + steps: |
| 81 | + - name: Checkout PR |
| 82 | + uses: actions/checkout@v3 |
| 83 | + if: github.event.pull_request.head.sha != '' |
| 84 | + with: |
| 85 | + submodules: true |
| 86 | + ref: ${{ github.event.pull_request.head.sha }} |
| 87 | + - name: Checkout |
| 88 | + uses: actions/checkout@v3 |
| 89 | + if: github.event.pull_request.head.sha == '' |
| 90 | + with: |
| 91 | + submodules: true |
| 92 | + - name: Install dependencies |
| 93 | + uses: ./.github/actions/prepare_vm |
| 94 | + - name: Prepare ccache timestamp |
| 95 | + id: ccache_cache_timestamp |
| 96 | + shell: cmake -P {0} |
| 97 | + run: | |
| 98 | + string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) |
| 99 | + message("::set-output name=timestamp::${current_date}") |
| 100 | + - name: Restore cache files |
| 101 | + uses: actions/cache/restore@v4 |
| 102 | + with: |
| 103 | + path: ~/.ccache |
| 104 | + key: ubuntu-22.04-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} |
| 105 | + restore-keys: | |
| 106 | + ubuntu-22.04-ccache- |
| 107 | + - name: Build |
| 108 | + uses: ./.github/actions/build |
| 109 | + - name: Test |
| 110 | + shell: bash |
| 111 | + run: | |
| 112 | + ctest -j32 --preset release-integration |
0 commit comments