Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
3 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# .github/workflows/build_x64_asan.yml
name: windows_x64_asan
 
on:
  push:
    branches: [main, 'rel-*']
  pull_request:
    branches: [main]
  workflow_dispatch:
 
concurrency:
  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }}
  cancel-in-progress: true
 
jobs:
  build_x64:
    runs-on: [
        "self-hosted",
        "1ES.Pool=onnxruntime-github-vs2022-mms",
        "JobId=windows-build-x64-asan-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}"
        ]
    timeout-minutes: 300
 
    env:
      # Number of GoogleTest shards to split the test run across.
      # Try increasing this if AddressSanitizer runs out of memory.
      SHARD_COUNT: 4
 
    steps:
      - name: Checkout repository
        uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
        with:
          submodules: false
 
      - name: Setup Python
        uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
        with:
          python-version: '3.12'
          architecture: x64
 
      - name: Locate vcvarsall and Setup Env
        uses: ./.github/actions/locate-vcvarsall-and-setup-env # Use the composite action
        with:
          architecture: x64
 
      - name: Setup VCPKG Cache
        uses: ./.github/actions/setup-vcpkg-cache
        with:
          key: windows-x64-build-asan-debug
          path: ${{ runner.temp }}/vcpkg-binary-cache
 
      - name: Write shared build options
        shell: pwsh
        run: |
          $ErrorActionPreference = 'Stop'
 
          $buildDir = Join-Path $env:RUNNER_TEMP 'build'
          $optsFile = Join-Path $env:RUNNER_TEMP 'asan_build_options.txt'
 
          # Common build.py options shared by the build and test phases below.
          @(
            '--config Debug'
            "--build_dir `"$buildDir`""
            '--skip_submodule_sync'
            '--parallel'
            '--use_vcpkg'
            '--use_vcpkg_ms_internal_asset_cache'
            '--cmake_generator "Visual Studio 17 2022"'
            '--disable_memleak_checker'
            '--enable_address_sanitizer'
          ) | Set-Content -Path $optsFile -Encoding ascii
 
          Write-Host "Wrote build options to ${optsFile}:"
 
          Get-Content $optsFile | Write-Host
 
      - name: Build
        shell: pwsh
        run: |
          $ErrorActionPreference = 'Stop'
 
          $buildPy  = Join-Path $env:GITHUB_WORKSPACE 'tools\ci_build\build.py'
          $optsFile = Join-Path $env:RUNNER_TEMP 'asan_build_options.txt'
          $reqFile  = Join-Path $env:GITHUB_WORKSPACE 'tools\ci_build\github\windows\python\requirements.txt'
 
          python -m pip install -r $reqFile
          if ($LASTEXITCODE -ne 0) { throw "pip install failed ($LASTEXITCODE)" }
 
          # '@' must be quoted so PowerShell does not treat it as the splat operator.
          python $buildPy "@$optsFile" --update --build
          if ($LASTEXITCODE -ne 0) { throw "Build failed ($LASTEXITCODE)" }
 
      - name: Test
        shell: pwsh
        run: |
          $ErrorActionPreference = 'Stop'
 
          $buildPy  = Join-Path $env:GITHUB_WORKSPACE 'tools\ci_build\build.py'
          $optsFile = Join-Path $env:RUNNER_TEMP 'asan_build_options.txt'
          $shardCount = [int]$env:SHARD_COUNT
          if ($shardCount -lt 1) { throw "SHARD_COUNT must be >= 1 (got $shardCount)" }
 
          # GoogleTest reads the GTEST_TOTAL_SHARDS and GTEST_SHARD_INDEX env vars.
          # Each ctest-launched test binary runs only its shard.
          $env:GTEST_TOTAL_SHARDS = $shardCount
 
          for ($i = 0; $i -lt $shardCount; $i++) {
            Write-Host "=== Running test shard $($i + 1) of $shardCount ==="
 
            $env:GTEST_SHARD_INDEX = $i
 
            # NOTE: The ctest commands produce a test output file with `--gtest_output=xml:...` that will be
            # overwritten by subsequent shard runs. This is fine for now since nothing consumes the output files.
            # If the output files are required, they can be renamed after each shard run so they don't get overwritten.
 
            # '@' must be quoted so PowerShell does not treat it as the splat operator.
            python $buildPy "@$optsFile" --test --test_parallel 4
            if ($LASTEXITCODE -ne 0) { throw "Test shard $($i + 1) of $shardCount failed ($LASTEXITCODE)" }
          }