Исходный код СУБД 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
120
121
# Tests on architectures other than x86_64. The aarch64 tests run natively on an ARM runner while the rest are emulated.
name: arch
 
on: workflow_call
 
# Limit permissions on the repository
permissions:
  contents: read
 
jobs:
  # Unit tests on aarch64 with valgrind
  aarch64:
    runs-on: ubuntu-22.04-arm
 
    # Allow pushing base images to the GHCR container cache
    permissions:
      contents: read
      packages: write
 
    steps:
      - name: Checkout Code
        uses: actions/checkout@v6
        with:
          path: pgbackrest
 
      - name: Update Apt
        uses: ./pgbackrest/.github/action/apt
 
      - name: Login to GHCR
        continue-on-error: true
        run: echo "${{secrets.GITHUB_TOKEN}}" | docker login ghcr.io -u ${{github.actor}} --password-stdin
 
      - name: Run Test
        run: |
          cd ${HOME?} && ${GITHUB_WORKSPACE?}/pgbackrest/test/ci.py test --vm=u22 --param=c-only --param=no-coverage \
            --param=no-back-trace
 
  # Basic tests on other architectures using emulation. The emulation is so slow that running all the unit tests would be too
  # expensive, but this at least shows that the build works and some of the more complex tests run. In particular, it is good to
  # test on one big-endian architecture to be sure that checksums are correct.
  emulated:
    runs-on: ubuntu-24.04
 
    # Allow pushing base images to the GHCR container cache
    permissions:
      contents: read
      packages: write
 
    strategy:
      # Let all the jobs run to completion even if one fails
      fail-fast: false
 
      matrix:
        include:
          - arch: 'ppc64le'
          - arch: 's390x'
 
    steps:
      - name: Checkout Code
        uses: actions/checkout@v6
        with:
          path: pgbackrest
 
      - name: Update Apt
        uses: ./pgbackrest/.github/action/apt
 
      - name: Install
        run: |
          sudo DEBCONF_NONINTERACTIVE_SEEN=true DEBIAN_FRONTEND=noninteractive apt-get install -y sudo python3-yaml \
            zlib1g-dev libssl-dev libxml2-dev libpq-dev pkg-config make gcc ccache meson git liblz4-dev liblz4-tool zstd \
            libzstd-dev bzip2 libbz2-dev
          docker run --privileged --rm tonistiigi/binfmt --install all
 
      - name: Login to GHCR
        continue-on-error: true
        run: echo "${{secrets.GITHUB_TOKEN}}" | docker login ghcr.io -u ${{github.actor}} --password-stdin
 
      - name: Build VM
        run: ${GITHUB_WORKSPACE?}/pgbackrest/test/test.py vm-build --vm=u22 --vm-arch=${{matrix.arch}}
 
      # Compiling under emulation is slow enough that a warm ccache saves a lot of time
      - name: Restore ccache
        uses: ./pgbackrest/.github/action/ccache
        with:
          mode: restore
          arch: ${{matrix.arch}}
          path: test/ccache
 
      - name: Run Test
        run: |
          ${GITHUB_WORKSPACE?}/pgbackrest/test/test.py --vm=u22 --vm-arch=${{matrix.arch}} --no-valgrind --no-coverage \
            --module=common/type/pack --module=common/crypto --module=common/compress --module=postgres/interface \
            --module=command/backup --module=command/restore --module=command/archive/get --module=command/archive/push \
            --module=command/verify
 
      # Run the smoke test against the arch build: a real PostgreSQL driven through a full backup/restore/verify cycle, which
      # exercises checksums end-to-end on big-endian. It reuses the pgbackrest binary already built for the arch above and the
      # single PostgreSQL version baked into the arch base image. A fresh container is started (test.py removes its own) with the
      # SSH entrypoint overridden and run as root so smoke.py can drop to the postgres user, as the misc smoke job does.
      #
      # The binary is copied to /tmp first: test.py creates the test tree mode 0770 owned by the build user, so the unprivileged
      # postgres user that smoke.py drops to cannot traverse it to execute the binary. /tmp is world-accessible -- it is where
      # smoke.py puts its own work dirs -- so the copy there is reachable.
      - name: Run Smoke Test
        run: |
          rm -rf /tmp/smoke && mkdir -p /tmp/smoke
          cp ${GITHUB_WORKSPACE?}/test/build/u22/src/pgbackrest /tmp/smoke/pgbackrest
          docker run --rm --platform linux/${{matrix.arch}} -u root --entrypoint python3 \
            -v ${GITHUB_WORKSPACE?}/pgbackrest:${GITHUB_WORKSPACE?}/pgbackrest \
            -v /tmp/smoke:/tmp/smoke \
            ghcr.io/pgbackrest/test:u22-test-${{matrix.arch}} \
            ${GITHUB_WORKSPACE?}/pgbackrest/test/smoke.py --pgbackrest /tmp/smoke/pgbackrest
 
      # Save on always() so the cache is still warmed even when tests fail
      - name: Save ccache
        if: always()
        uses: ./pgbackrest/.github/action/ccache
        with:
          mode: save
          arch: ${{matrix.arch}}
          path: test/ccache