Skip to content

Commit 3cf50f5

Browse files
committed
Draft workflow
1 parent 5af4d0f commit 3cf50f5

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: pgindent check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
pgindent:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Install dependencies
17+
run: |
18+
sudo apt-get update
19+
sudo apt-get install -y \
20+
curl \
21+
build-essential \
22+
libreadline-dev \
23+
zlib1g-dev \
24+
flex \
25+
bison \
26+
libxml2-dev \
27+
libxslt1-dev \
28+
libssl-dev
29+
30+
- name: Clone and build pg_bsd_indent
31+
run: |
32+
git clone https://git.postgresql.org/git/postgresql.git --depth 1 --branch master /tmp/postgresql
33+
cd /tmp/postgresql
34+
./configure --prefix=/tmp/pg-build
35+
cd src/tools/pg_bsd_indent
36+
make
37+
sudo make install prefix=/usr/local
38+
39+
- name: Run gen-typedefs.sh and check formatting
40+
working-directory: utils/pgindent
41+
run: |
42+
chmod +x gen-typedefs.sh
43+
./gen-typedefs.sh
44+
45+
- name: Check for formatting changes
46+
run: |
47+
if ! git diff --quiet; then
48+
echo "::error::Code formatting issues detected. Please run gen-typedefs.sh locally."
49+
git diff
50+
exit 1
51+
fi
52+
echo "All files are properly formatted."

0 commit comments

Comments
 (0)