File tree Expand file tree Collapse file tree
actions/build-and-install Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333 run : |
3434 python3.11 -m pipenv install --dev
3535
36- - name : Check formatting
37- shell : bash
38- run : |
39- make check-indent PG_INDENT=/home/postgres/pgsql-${PG_INDENT_VERSION}/bin/pgindent
40-
4136 - name : Check for typos # ;)
4237 uses : ./.github/actions/check-typos
4338
Original file line number Diff line number Diff line change 1+ name : Check formatting for pg_lake repos
2+
3+ on :
4+ workflow_call :
5+ inputs :
6+ pg_version :
7+ required : true
8+ type : string
9+ image_tag :
10+ required : true
11+ type : string
12+
13+ env :
14+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 : true
15+
16+ jobs :
17+ lint :
18+ runs-on : ubuntu-latest
19+
20+ container :
21+ image : ghcr.io/snowflake-labs/pg-lake-ci-pg-almalinux:${{ inputs.image_tag }}
22+ options : --user 1001 --shm-size=128MB
23+ volumes :
24+ - /usr/local:/host/usr/local
25+ credentials :
26+ username : ${{ github.actor }}
27+ password : ${{ secrets.GITHUB_TOKEN }}
28+
29+ steps :
30+ - uses : actions/checkout@v4
31+ name : Check out repository code
32+ with :
33+ fetch-depth : 0
34+
35+ - name : Export PGDIR, PATH and PG_REGRESS_DIR
36+ run : |
37+ echo "PGDIR=/home/postgres/pgsql-${{ inputs.pg_version }}" >> $GITHUB_ENV
38+ echo "PATH=/home/postgres/pgsql-${{ inputs.pg_version }}/bin:$PATH" >> $GITHUB_ENV
39+ echo "PG_REGRESS_DIR=/home/postgres/pgsql-${{ inputs.pg_version }}/regress" >> $GITHUB_ENV
40+
41+ - uses : actions/cache@v4
42+ id : cache_pipenv
43+ name : Cache pipenv
44+ with :
45+ path : ~/.local/share/virtualenvs
46+ key : ${{ runner.os }}-python-3.11-pipenv-${{ hashFiles('Pipfile.lock') }}
47+
48+ - name : Install pipenv dependencies
49+ if : steps.cache_pipenv.outputs.cache-hit != 'true'
50+ run : |
51+ python3.11 -m pipenv install --dev
52+
53+ - name : Check formatting
54+ run : |
55+ make check-indent
Original file line number Diff line number Diff line change @@ -131,6 +131,14 @@ jobs:
131131 container_os : ' debian'
132132 pg_version : ${{ matrix.pg_version }}
133133
134+ # Formatting checks only on one postgres version
135+ lint-check-18 :
136+ needs : [build-image-almalinux]
137+ uses : ./.github/workflows/lint.yml
138+ with :
139+ pg_version : " 18"
140+ image_tag : ${{ needs.build-image-almalinux.outputs.tag }}
141+
134142 test-check :
135143 needs : [build-image-almalinux, build-and-install-almalinux]
136144 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change @@ -48,9 +48,7 @@ UNAME_S := $(shell uname -s)
4848
4949# List of targets for indent checks
5050INDENT_TARGETS = pgduck_server $(EXTENSION_TARGETS )
51- PG_INDENT_VERSION = 18
52- PG_INDENT ?= pgindent
53- TYPEDEFS = /tmp/typedefs-$(PG_INDENT_VERSION ) .list
51+ TYPEDEFS = /tmp/typedefs-$(PG_MAJOR_VERSION ) .list
5452
5553CMAKE_AVRO_ARGS = -DCMAKE_INSTALL_PREFIX=avrolib -DCMAKE_BUILD_TYPE=RelWithDebInfo
5654
@@ -65,22 +63,22 @@ endif
6563
6664# style/indent-related changes
6765
68- # This target ensures that we download the PG_INDENT_VERSION 's typedefs.list
66+ # This target ensures that we download the latest major version 's typedefs.list
6967# from buildfarm if we don't have a local copy. Since we currently do not
7068# override the typedefs.list, this should be equivalent to what we were
7169# previously doing by pulling from the postgres source tree.
7270
7371typedefs : $(TYPEDEFS )
7472
7573$(TYPEDEFS ) :
76- curl -o $(TYPEDEFS ) https://buildfarm.postgresql.org/cgi-bin/typedefs.pl? branch=REL_$(PG_INDENT_VERSION ) _STABLE
74+ curl -o $(TYPEDEFS ) https://buildfarm.postgresql.org/cgi-bin/typedefs.pl? branch=REL_$(PG_MAJOR_VERSION ) _STABLE
7775
7876check-indent : typedefs
79- $( PG_INDENT ) --typedefs=$(TYPEDEFS ) --check --diff $(INDENT_TARGETS )
77+ pgindent --typedefs=$(TYPEDEFS ) --check --diff $(INDENT_TARGETS )
8078 pipenv run black --check --diff $(INDENT_TARGETS )
8179
8280reindent : typedefs
83- $( PG_INDENT ) --typedefs=$(TYPEDEFS ) $(INDENT_TARGETS )
81+ pgindent --typedefs=$(TYPEDEFS ) $(INDENT_TARGETS )
8482 pipenv run black $(INDENT_TARGETS )
8583
8684submodules :
You can’t perform that action at this time.
0 commit comments