-
Notifications
You must be signed in to change notification settings - Fork 3
74 lines (58 loc) · 2.01 KB
/
ci.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
#
# https://docs.github.com/en/actions
# https://github.com/actions
#
name: CI
on:
pull_request: {}
push: {}
jobs:
linux:
name: "Ubuntu 18.04 + PostgreSQL ${{matrix.PGVER}}"
runs-on: ubuntu-18.04
strategy:
matrix:
PGVER: [10, 11, 12, 13]
steps:
- name: "Checkout"
uses: actions/checkout@v2
- name: "InstallDB"
run: |
echo "::group::apt-get-update"
echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main ${{matrix.PGVER}}" \
| sudo tee /etc/apt/sources.list.d/pgdg.list
sudo -nH apt-get -q update
echo "::endgroup::"
echo "::group::apt-get-install"
# disable new cluster creation
sudo -nH mkdir -p /etc/postgresql-common/createcluster.d
echo "create_main_cluster = false" | sudo -nH tee /etc/postgresql-common/createcluster.d/no-main.conf
sudo -nH apt-get -qyu install \
postgresql-${{matrix.PGVER}} \
postgresql-server-dev-${{matrix.PGVER}} \
libpq-dev patchutils
echo "::endgroup::"
# tune environment
echo "/usr/lib/postgresql/${{matrix.PGVER}}/bin" >> $GITHUB_PATH
echo "PGHOST=/tmp" >> $GITHUB_ENV
dpkg -l postgres\* libpq\* bison\* flex\* gcc\* clang\* libllvm\*
- name: "Build"
run: make
- name: "Install"
run: |
git clone -q https://github.com/pgq/pgq; make -C pgq
sudo -nH bash -c "PATH='${PATH}' make install -C pgq"
sudo -nH bash -c "PATH='${PATH}' make install"
- name: "StartDB"
run: |
rm -rf data log
mkdir -p log
LANG=C initdb data
sed -ri -e "s,^[# ]*(unix_socket_directories).*,\\1='/tmp'," data/postgresql.conf
pg_ctl -D data -l log/pg.log start || { cat log/pg.log ; exit 1; }
- name: "Test"
run: make citest
- name: "StopDB"
run: |
pg_ctl -D data stop
rm -rf data log /tmp/.s.PGSQL*