-
Notifications
You must be signed in to change notification settings - Fork 61
188 lines (179 loc) · 7.08 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
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Add PostgreSQL apt repository
run: |
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo wget --quiet --output-document /etc/apt/trusted.gpg.d/apt.postgresql.org.asc https://www.postgresql.org/media/keys/ACCC4CF8.asc
- name: Update system
run: sudo apt update
- name: Install libev
run: sudo apt install -y libev4 libev-dev
- name: Install cJSON
run: sudo apt install -y libcjson1 libcjson-dev
- name: Install systemd
run: sudo apt install -y libsystemd-dev
- name: Install rst2man
run: sudo apt install -y python3-docutils
- name: Install graphviz
run: sudo apt install graphviz
- name: Install doxygen
run: sudo apt install doxygen
- name: Install clang
run: sudo apt install -y clang
- name: Install PostgreSQL
run: sudo apt install -y postgresql
- name: Start postgres
run: |
version=$(pg_config --version | grep -Eo "[0-9]{1,2}" | head -1)
sudo -u postgres /usr/lib/postgresql/${version}/bin/pg_ctl start -D /etc/postgresql/${version}/main/
- name: GCC/mkdir
run: mkdir build
working-directory: /home/runner/work/pgagroal/pgagroal/
- name: GCC/cmake
run: sudo apt install cmake && export CC=/usr/bin/gcc && cmake -DCMAKE_BUILD_TYPE=Debug ..
working-directory: /home/runner/work/pgagroal/pgagroal/build/
- name: GCC/make
run: make
working-directory: /home/runner/work/pgagroal/pgagroal/build/
- name: GCC/Run pgagroal & confirm pgagroal is running
run: |
sudo mkdir -p /etc/pgagroal
sudo cp ../../doc/etc/*.conf /etc/pgagroal
./pgagroal >> /dev/null 2>&1 &
pid=$!
sleep 5
./pgagroal-cli ping
working-directory: /home/runner/work/pgagroal/pgagroal/build/src/
- name: GCC/Stop pgagroal & postgres
run: |
./pgagroal-cli shutdown
version=$(pg_config --version | grep -Eo "[0-9]{1,2}" | head -1)
sudo -u postgres /usr/lib/postgresql/${version}/bin/pg_ctl stop -D /etc/postgresql/${version}/main/
working-directory: /home/runner/work/pgagroal/pgagroal/build/src/
- name: rm -Rf
run: rm -Rf build/
working-directory: /home/runner/work/pgagroal/pgagroal/
- name: Start postgres
run: |
version=$(pg_config --version | grep -Eo "[0-9]{1,2}" | head -1)
sudo -u postgres /usr/lib/postgresql/${version}/bin/pg_ctl start -D /etc/postgresql/${version}/main/
- name: CLANG/mkdir
run: mkdir build
working-directory: /home/runner/work/pgagroal/pgagroal/
- name: CLANG/cmake
run: export CC=/usr/bin/clang && cmake -DCMAKE_BUILD_TYPE=Debug ..
working-directory: /home/runner/work/pgagroal/pgagroal/build/
- name: CLANG/make
run: make
working-directory: /home/runner/work/pgagroal/pgagroal/build/
- name: CLANG/Run pgagroal & confirm pgagroal is running
run: |
sudo mkdir -p /etc/pgagroal
sudo cp ../../doc/etc/*.conf /etc/pgagroal
./pgagroal >> /dev/null 2>&1 &
pid=$!
sleep 5
./pgagroal-cli ping
working-directory: /home/runner/work/pgagroal/pgagroal/build/src/
- name: CLANG/Stop pgagroal & postgres
run: |
./pgagroal-cli shutdown
version=$(pg_config --version | grep -Eo "[0-9]{1,2}" | head -1)
sudo -u postgres /usr/lib/postgresql/${version}/bin/pg_ctl stop -D /etc/postgresql/${version}/main/
working-directory: /home/runner/work/pgagroal/pgagroal/build/src/
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install Homebrew
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
- name: Update system
run: brew update
- name: Install openssl
run: brew install openssl
- name: Install libev
run: brew install libev
- name: Install cJSON
run: brew install cjson
- name: Install rst2man
run: brew install docutils
- name: Install graphviz
run: sudo apt install graphviz
- name: Install doxygen
run: sudo apt install doxygen
- name: Install clang
run: brew install llvm
- name: Install PostgreSQL
run: |
latest_pg=$(brew search postgresql | grep postgresql@ | tail -n 1)
brew install ${latest_pg} || true # `|| true` prevents install errors from breaking the run
- name: Start postgres
run: |
installed_pg=$(brew search postgresql | grep postgresql@ | tail -n 1)
brew services start ${installed_pg}
- name: GCC/mkdir
run: mkdir build
working-directory: /Users/runner/work/pgagroal/pgagroal/
- name: GCC/cmake
run: export CC=/usr/bin/gcc && export OPENSSL_ROOT_DIR=`brew --prefix openssl` && cmake -DCMAKE_BUILD_TYPE=Debug ..
working-directory: /Users/runner/work/pgagroal/pgagroal/build/
- name: GCC/make
run: make
working-directory: /Users/runner/work/pgagroal/pgagroal/build/
- name: GCC/Run pgagroal & confirm pgagroal is running
run: |
sudo mkdir -p /etc/pgagroal
sudo cp ../../doc/etc/*.conf /etc/pgagroal
./pgagroal >> /dev/null 2>&1 &
pid=$!
sleep 5
./pgagroal-cli ping
working-directory: /Users/runner/work/pgagroal/pgagroal/build/src/
- name: GCC/Stop pgagroal & postgres
run: |
./pgagroal-cli shutdown
installed_pg=$(brew search postgresql | grep postgresql@ | tail -n 1)
brew services stop ${installed_pg}
working-directory: /Users/runner/work/pgagroal/pgagroal/build/src/
- name: rm -Rf
run: rm -Rf build/
working-directory: /Users/runner/work/pgagroal/pgagroal/
- name: Start postgres
run: |
installed_pg=$(brew search postgresql | grep postgresql@ | tail -n 1)
brew services start ${installed_pg}
- name: CLANG/mkdir
run: mkdir build
working-directory: /Users/runner/work/pgagroal/pgagroal/
- name: CLANG/cmake
run: export CC=/usr/bin/clang && export OPENSSL_ROOT_DIR=`brew --prefix openssl` && cmake -DCMAKE_BUILD_TYPE=Debug ..
working-directory: /Users/runner/work/pgagroal/pgagroal/build/
- name: CLANG/make
run: make
working-directory: /Users/runner/work/pgagroal/pgagroal/build/
- name: CLANG/Run pgagroal & confirm pgagroal is running
run: |
sudo mkdir -p /etc/pgagroal
sudo cp ../../doc/etc/*.conf /etc/pgagroal
./pgagroal >> /dev/null 2>&1 &
pid=$!
sleep 5
./pgagroal-cli ping
working-directory: /Users/runner/work/pgagroal/pgagroal/build/src/
- name: CLANG/Stop pgagroal & postgres
run: |
./pgagroal-cli shutdown
installed_pg=$(brew search postgresql | grep postgresql@ | tail -n 1)
brew services stop ${installed_pg}
working-directory: /Users/runner/work/pgagroal/pgagroal/build/src/