-
Notifications
You must be signed in to change notification settings - Fork 2
155 lines (133 loc) · 4.5 KB
/
Copy pathbuild-and-test.yml
File metadata and controls
155 lines (133 loc) · 4.5 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
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Reusable build and test
on:
workflow_call:
inputs:
pg_version:
type: string
required: true
os:
type: string
required: true
compiler:
type: string
required: true
build_type:
type: string
required: true
env:
artifact_name: build-${{ inputs.pg_version }}-${{ inputs.os }}-${{ inputs.compiler }}-${{ inputs.build_type }}
CC: ${{ inputs.compiler }}
jobs:
build:
name: Build
runs-on: ${{ inputs.os }}
timeout-minutes: 10
steps:
- name: Clone repository
uses: actions/checkout@v6
with:
path: src
submodules: recursive
ref: ${{ github.ref }}
- name: Clone postgres repository
uses: actions/checkout@v6
with:
path: postgres
repository: percona/postgres.git
ref: PSP_REL_${{ inputs.pg_version }}_STABLE
- name: Install dependencies for Ubuntu
if: startsWith(inputs.os, 'ubuntu-')
run: src/ci_scripts/ubuntu-deps.sh
- name: Install dependencies for MacOS
if: startsWith(inputs.os, 'macos-')
run: src/ci_scripts/macos-deps.sh
- name: Build postgres
run: src/ci_scripts/build-and-install-psp.sh ${{ inputs.build_type }}
- name: Build open_pg_tde
run: src/ci_scripts/build.sh ${{ inputs.build_type }}
- name: Add build and install to artifact tar file
run: tar -czf artifacts.tar src build postgres pginst
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: ${{ env.artifact_name }}
overwrite: true
path: |
artifacts.tar
retention-days: 1
test:
name: Test
runs-on: ${{ inputs.os }}
needs: build
timeout-minutes: 20
env:
# No cosmian_kms package on macOS; let kmip.pl skip_all there.
PG_TEST_REQUIRE_COSMIAN_KMS: ${{ startsWith(inputs.os, 'macos-') && '0' || '1' }}
PG_TEST_REQUIRE_OPENBAO: '1'
steps:
- name: Download build artifacts
uses: actions/download-artifact@v8
with:
name: ${{ env.artifact_name }}
path: .
- name: Extract artifact file
run: tar -xzf artifacts.tar
- name: Install dependencies for Ubuntu
if: startsWith(inputs.os, 'ubuntu-')
run: src/ci_scripts/ubuntu-deps.sh
- name: Install dependencies for MacOS
if: startsWith(inputs.os, 'macos-')
run: src/ci_scripts/macos-deps.sh
- name: Test open_pg_tde
run: src/ci_scripts/test.sh
- name: Report on test fail
uses: actions/upload-artifact@v7
if: ${{ failure() }}
with:
name: log-test-${{ inputs.pg_version }}-${{ inputs.os }}-${{ inputs.compiler }}-${{ inputs.build_type }}
path: |
build/meson-logs/testlog.txt
build/regress_install
build/regress_install.log
build/regression.diffs
build/results
build/testrun
retention-days: 3
test-psp-with-tde:
name: Test PSP with TDE enabled by default
runs-on: ${{ inputs.os }}
needs: build
timeout-minutes: 30
# Skip PSP tests for MacOS because it doesn't support TDE archiving commands.
if: ${{ ! startsWith(inputs.os, 'macos-') }}
steps:
- name: Download build artifacts
uses: actions/download-artifact@v8
with:
name: ${{ env.artifact_name }}
path: .
- name: Extract artifact file
run: tar -xzf artifacts.tar
- name: Install dependencies for Ubuntu
run: src/ci_scripts/ubuntu-deps.sh
- name: Test postgres with TDE as default access method
run: src/ci_scripts/test-global-tde.sh --continue
- name: Report on test fail
uses: actions/upload-artifact@v7
if: ${{ failure() }}
with:
name: log-test-global-tde-${{ inputs.pg_version }}-${{ inputs.os }}-${{ inputs.compiler }}-${{ inputs.build_type }}
path: |
pginst/postgresql.log
postgres/contrib/*/log
postgres/contrib/*/regression.diffs
postgres/contrib/*/regression.out
postgres/contrib/*/results
postgres/contrib/*/tmp_check
postgres/src/bin/*/tmp_check
postgres/src/test/*/log
postgres/src/test/*/regression.diffs
postgres/src/test/*/regression.out
postgres/src/test/*/results
postgres/src/test/*/tmp_check
retention-days: 3