Skip to content

Commit 8749d82

Browse files
authored
Update run-tests.yml citus tools version (#1078)
* Update run-tests.yml citus tools version * review install script for uncrustify * Review Citus tools install scripts for CI * -DCMAKE_POLICY_VERSION_MINIMUM=3.5 * Exclude ci/tools from black indentation rules
1 parent 5af15c8 commit 8749d82

File tree

4 files changed

+51
-6
lines changed

4 files changed

+51
-6
lines changed

.github/workflows/run-tests.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ jobs:
5252
pip3 install --user black
5353
black --version
5454
gcc --version
55-
git clone -b v0.8.31 --depth 1 https://github.com/citusdata/tools.git ../tools
56-
sudo make -C ../tools install
57-
install_uncrustify
58-
rm -rf uncrustify*
55+
# Install uncrustify the Citus way
56+
make -C ci -f tools.mk tools
5957
6058
- name: Check code formatting and banned function
6159
if: ${{ env.TEST == 'linting' }}

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ endif
191191
.PHONY: indent
192192
indent:
193193
citus_indent
194-
black .
194+
black --exclude=ci/tools .
195195

196196
# make lint; is an alias for make spellcheck
197197
# make linting; is an alias for make spellcheck
@@ -203,7 +203,7 @@ lint linting: spellcheck ;
203203
.PHONY: spellcheck
204204
spellcheck:
205205
citus_indent --check
206-
black --check .
206+
black --exclude=ci/tools --check .
207207
ci/banned.h.sh
208208

209209
#

ci/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM debian:bullseye-slim
2+
3+
RUN apt-get update \
4+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
5+
build-essential \
6+
ca-certificates \
7+
curl \
8+
git \
9+
gawk \
10+
make \
11+
cmake \
12+
python3 \
13+
sudo \
14+
&& rm -rf /var/lib/apt/lists/*
15+
16+
WORKDIR /usr/src/pg_auto_failover/ci
17+
COPY tools.mk ./
18+
19+
WORKDIR /usr/src/pg_auto_failover
20+
RUN make -C ci -f tools.mk tools

ci/tools.mk

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
# Install CI tools, mostly Citus style checker and linter for C code.
3+
#
4+
# See https://github.com/citusdata/citus/blob/main/STYLEGUIDE.md
5+
#
6+
7+
CITUS_TOOLS = https://github.com/citusdata/tools.git
8+
UNCRUSTIFY = https://github.com/uncrustify/uncrustify/archive/uncrustify-0.68.1.tar.gz
9+
UNCRUSTIFY_DIR = uncrustify-uncrustify-0.68.1
10+
11+
CMAKE_OPTS = -DCMAKE_POLICY_VERSION_MINIMUM=3.5
12+
13+
tools: citus-tools ;
14+
15+
mkdir:
16+
mkdir tools
17+
18+
uncrustify: mkdir
19+
curl -L $(UNCRUSTIFY) | tar -C tools -xz
20+
mkdir tools/$(UNCRUSTIFY_DIR)/build
21+
cd tools/$(UNCRUSTIFY_DIR)/build && cmake $(CMAKE_OPTS) ..
22+
make -C tools/$(UNCRUSTIFY_DIR)/build -j5
23+
sudo make -C tools/$(UNCRUSTIFY_DIR)/build install
24+
25+
citus-tools: uncrustify
26+
git clone --depth 1 $(CITUS_TOOLS) tools/tools
27+
sudo make -C tools/tools uncrustify/.install

0 commit comments

Comments
 (0)