forked from percona/pg_stat_monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (65 loc) · 2.4 KB
/
pg12test.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
name: pg12-test
on: [push]
jobs:
build:
name: pg12-test
runs-on: ubuntu-latest
steps:
- name: Clone postgres repository
uses: actions/checkout@v2
with:
repository: 'postgres/postgres'
ref: 'REL_12_STABLE'
- name: Clone pg_stat_monitor repository
uses: actions/checkout@v2
with:
path: 'src/pg_stat_monitor'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt purge postgresql-client-common postgresql-common postgresql postgresql*
sudo apt-get install libreadline6-dev systemtap-sdt-dev zlib1g-dev libssl-dev libpam0g-dev python-dev bison flex libipc-run-perl -y
sudo rm -rf /var/lib/postgresql/
sudo rm -rf /var/log/postgresql/
sudo rm -rf /etc/postgresql/
sudo rm -rf /usr/lib/postgresql
sudo rm -rf /usr/include/postgresql
sudo rm -rf /usr/share/postgresql
sudo rm -rf /etc/postgresql
sudo rm -f /usr/bin/pg_config
- name: Create pgsql dir
run: sudo mkdir -p /opt/pgsql
- name: Build postgres
run: |
export PATH="/opt/pgsql/bin:$PATH"
./configure --enable-tap-tests --prefix=/opt/pgsql
make
make install
- name: Start postgresql cluster
run: |
export PATH="/opt/pgsql/bin:$PATH"
/opt/pgsql/bin/initdb -D /opt/pgsql/data
/opt/pgsql/bin/pg_ctl -D /opt/pgsql/data -l logfile start
- name: Build pg_stat_monitor
run: |
export PATH="/opt/pgsql/bin:$PATH"
sudo cp /opt/pgsql/bin/pg_config /usr/bin
make USE_PGXS=1
make USE_PGXS=1 install
working-directory: src/pg_stat_monitor/
- name: Start pg_stat_monitor_tests
run: |
/opt/pgsql/bin/pg_ctl -D /opt/pgsql/data -l logfile stop
echo "shared_preload_libraries = 'pg_stat_monitor'" >> /opt/pgsql/data/postgresql.conf
/opt/pgsql/bin/pg_ctl -D /opt/pgsql/data -l logfile start
make installcheck
working-directory: src/pg_stat_monitor/
- name: Report on test fail
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: Regressions diff and postgresql log
path: |
src/pg_stat_monitor/regression.diffs
src/pg_stat_monitor/logfile
retention-days: 1