-
Notifications
You must be signed in to change notification settings - Fork 59
141 lines (128 loc) · 6.11 KB
/
postgresql-13-build.yml
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
# name: postgresql-13-build
# on: [push]
# jobs:
# build:
# name: pg-13-build-test
# runs-on: ubuntu-22.04
# steps:
# - name: Clone postgres repository
# uses: actions/checkout@v2
# with:
# repository: 'postgres/postgres'
# ref: 'REL_13_STABLE'
# - name: Install dependencies
# run: |
# sudo apt-get update
# sudo apt purge postgresql-client-common postgresql-common \
# postgresql postgresql*
# sudo apt-get install -y libreadline6-dev systemtap-sdt-dev \
# zlib1g-dev libssl-dev libpam0g-dev bison flex \
# libipc-run-perl -y docbook-xsl docbook-xsl libxml2 libxml2-utils \
# libxml2-dev libxslt-dev xsltproc libkrb5-dev libldap2-dev \
# libsystemd-dev gettext tcl-dev libperl-dev pkg-config clang-11 \
# llvm-11 llvm-11-dev libselinux1-dev python3-dev uuid-dev liblz4-dev
# sudo rm -rf /var/lib/postgresql /var/log/postgresql /etc/postgresql \
# /usr/lib/postgresql /usr/include/postgresql /usr/share/postgresql \
# /etc/postgresql
# sudo rm -f /usr/bin/pg_config
# sudo /usr/bin/perl -MCPAN -e 'install IPC::RUN'
# sudo /usr/bin/perl -MCPAN -e 'install Text::Trim'
# - name: Create pgsql dir
# run: mkdir -p /opt/pgsql
# - name: Build postgres
# run: |
# export PATH="/opt/pgsql/bin:$PATH"
# ./configure '--build=x86_64-linux-gnu' '--prefix=/usr' \
# '--includedir=${prefix}/include' \
# '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' \
# '--sysconfdir=/etc' '--localstatedir=/var' '--with-icu' \
# '--libdir=${prefix}/lib/x86_64-linux-gnu' '--with-perl' \
# '--libexecdir=${prefix}/lib/x86_64-linux-gnu' '--enable-debug' \
# '--with-tcl' '--with-pam' '--with-python' '--with-openssl' \
# '--with-libxml' '--with-libxslt' '--enable-tap-tests' \
# 'PYTHON=/usr/bin/python3' '--mandir=/usr/share/postgresql/13/man' \
# '--docdir=/usr/share/doc/postgresql-doc-13' 'AWK=mawk' \
# '--sysconfdir=/etc/postgresql-common' '--datarootdir=/usr/share' \
# '--datadir=/usr/share/postgresql/13' '--enable-nls' \
# '--bindir=/usr/lib/postgresql/13/bin' '--enable-dtrace' \
# '--libdir=/usr/lib/x86_64-linux-gnu' '--disable-rpath' \
# '--libexecdir=/usr/lib/postgresql' '--enable-thread-safety' \
# '--includedir=/usr/include/postgresql' 'TAR=/bin/tar' \
# '--with-uuid=e2fs' '--with-gnu-ld' 'XSLTPROC=xsltproc --nonet' \
# '--with-pgport=5432' '--with-system-tzdata=/usr/share/zoneinfo' \
# '--with-llvm' 'LLVM_CONFIG=/usr/bin/llvm-config-11' \
# 'CLANG=/usr/bin/clang-11' '--with-systemd' '--with-selinux' \
# 'MKDIR_P=/bin/mkdir -p' 'PROVE=/usr/bin/prove' \
# 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now' \
# '--with-gssapi' '--with-ldap' 'build_alias=x86_64-linux-gnu' \
# 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' \
# 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer' \
# 'CXXFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security'
# make world
# sudo make install-world
# - name: Start postgresql cluster
# run: |
# export PATH="/usr/lib/postgresql/13/bin:$PATH"
# sudo cp /usr/lib/postgresql/13/bin/pg_config /usr/bin
# initdb -D /opt/pgsql/data
# pg_ctl -D /opt/pgsql/data -l logfile start
# - name: Clone pg_stat_monitor repository
# uses: actions/checkout@v2
# with:
# path: 'src/pg_stat_monitor'
# - name: Build pg_stat_monitor
# run: |
# make USE_PGXS=1
# sudo make USE_PGXS=1 install
# working-directory: src/pg_stat_monitor
# - name: Load pg_stat_monitor library and Restart Server
# run: |
# export PATH="/usr/lib/postgresql/13/bin:$PATH"
# pg_ctl -D /opt/pgsql/data -l logfile stop
# echo "shared_preload_libraries = 'pg_stat_monitor'" >> \
# /opt/pgsql/data/postgresql.conf
# pg_ctl -D /opt/pgsql/data -l logfile start
# working-directory: src/pg_stat_monitor
# - name: Start pg_stat_monitor_tests
# run: |
# make installcheck
# working-directory: src/pg_stat_monitor
# - name: Change dir permissions on fail
# if: ${{ failure() }}
# run: |
# sudo chmod -R ugo+rwx t
# sudo chmod -R ugo+rwx tmp_check
# exit 2 # regenerate error so that we can upload files in next step
# working-directory: src/pg_stat_monitor
# - name: Upload logs on fail
# if: ${{ failure() }}
# uses: actions/upload-artifact@v2
# with:
# name: Regressions diff and postgresql log
# path: |
# src/pg_stat_monitor/regression.diffs
# src/pg_stat_monitor/regression.out
# src/pg_stat_monitor/logfile
# src/pg_stat_monitor/t/results/
# src/pg_stat_monitor/tmp_check/log/
# !src/pg_stat_monitor/tmp_check/**/archives/*
# !src/pg_stat_monitor/tmp_check/**/backup/*
# !src/pg_stat_monitor/tmp_check/**/pgdata/*
# !src/pg_stat_monitor/tmp_check/**/archives/
# !src/pg_stat_monitor/tmp_check/**/backup/
# !src/pg_stat_monitor/tmp_check/**/pgdata/
# if-no-files-found: warn
# retention-days: 1
# - name: Start Server installcheck-world tests
# run: |
# make installcheck-world
# - name: Report on installcheck-world test suites fail
# uses: actions/upload-artifact@v2
# if: ${{ failure() }}
# with:
# name: Regressions output files of failed testsuite, and pg log
# path: |
# **/regression.diffs
# **/regression.out
# src/pg_stat_monitor/logfile
# retention-days: 3