Skip to content

Commit bd3585b

Browse files
committed
Improve basic CI and installcheck CI code.
1 parent 492699a commit bd3585b

File tree

3 files changed

+48
-47
lines changed

3 files changed

+48
-47
lines changed

‎./workflows/c-cpp.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515
- uses: actions/checkout@v3
1616
- name: "Define PostreSQL major version"
1717
run: |
18-
echo "$(ls -la)"
1918
_name=$(ls aqo_*.|tail -1)
2019
echo "CORE__NAME=$_name" >> $_ENV
2120
@@ -49,7 +48,6 @@ jobs:
4948
run: |
5049
git clone -b $PG_BRANCH --depth=1 --single-branch https://.com/postgres/postgres.git $_WORKSPACE/../pg
5150
cd $_WORKSPACE/../pg
52-
ls -la
5351
cp -r ../aqo contrib/aqo
5452
-p1 --no-backup-if-mismatch < contrib/aqo/$CORE__NAME
5553
@@ -70,7 +68,7 @@ jobs:
7068
env CLIENTS=50 THREADS=50 make -C contrib/aqo check
7169
7270
- name: Archive artifacts
73-
if: ${{ always() }}
71+
if: ${{ failure() }}
7472
uses: actions/upload-artifact@v3
7573
with:
7674
name: make_check_logs

‎./workflows/installchecks.yml

+46-44
Original file line numberDiff line numberDiff line change
@@ -14,66 +14,68 @@ jobs:
1414
steps:
1515

1616
# Set major PostgreSQL version for all underlying steps
17-
- name: "Extract Postgres major version number"
17+
- uses: actions/checkout@v3
18+
- name: "Define PostreSQL major version"
1819
run: |
19-
PG_MAJOR_VERSION=$(echo "$BRANCH_NAME" | grep --only-matching 'stable[0-9].' | grep --only-matching '[0-9].')
20+
_name=$(ls aqo_*.|tail -1)
21+
echo "CORE__NAME=$_name" >> $_ENV
2022
21-
# Declare PG_MAJOR_VERSION as a environment variable
22-
echo "PG_MAJOR_VERSION=$PG_MAJOR_VERSION" >> $_ENV
23-
echo "CORE_BRANCH_NAME=REL_${PG_MAJOR_VERSION}_STABLE" >> $_ENV
24-
echo "AQO__NAME=aqo_pg$PG_MAJOR_VERSION." >> $_ENV
25-
- name: "Set proper names for the master case"
23+
# we can get number, otherwise set up master
24+
vers_number=$(echo "$_name"|tr -d -c 0-9)
25+
echo "PG_MAJOR_VERSION=$vers_number" >> $_ENV
26+
27+
branch_name="REL_${vers_number}_STABLE"
28+
echo "PG_BRANCH=$branch_name" >> $_ENV
29+
30+
- name: "Set master branch name, if needed"
2631
if: env.PG_MAJOR_VERSION == ''
2732
run: |
28-
echo "PG_MAJOR_VERSION=master" >> $_ENV
29-
echo "CORE_BRANCH_NAME=master" >> $_ENV
30-
echo "AQO__NAME=aqo_master." >> $_ENV
33+
branch_name="master"
34+
echo "PG_BRANCH=$branch_name" >> $_ENV
3135
32-
- name: "Preparations"
36+
- name: "Environment (debug output)"
37+
if: ${{ always() }}
3338
run: |
34-
sudo apt install libipc-run-perl libxml2-utils libxml2-dev xsltproc libxslt1-dev
35-
36-
echo "Deploying to production server on branch" $BRANCH_NAME
39+
echo "Use PostgreSQL branch $PG_BRANCH (: $CORE__NAME)"
40+
echo "Deploying to production server on branch" $BRANCH_NAME "(PG $PG_BRANCH)"
3741
git config --global user.email "[email protected]"
3842
git config --global user.name "CI PgPro admin"
39-
git clone https://.com/postgres/postgres.git pg
40-
cd pg
41-
git checkout $CORE_BRANCH_NAME
42-
git clone https://.com/postgrespro/aqo.git contrib/aqo
43-
git -C contrib/aqo checkout $BRANCH_NAME
44-
-p1 --no-backup-if-mismatch < contrib/aqo/$AQO__NAME
45-
COPT="-Werror"
46-
CONFIGURE_OPTS="--prefix=`pwd`/tmp_install --enable-tap-tests --enable-cassert"
47-
echo "CONFIGURE_OPTS=$CONFIGURE_OPTS" >> $_ENV
48-
echo "COPT=$COPT" >> $_ENV
43+
44+
- name: "Prepare PG directory"
45+
run: |
46+
sudo apt install libipc-run-perl libxml2-utils libxml2-dev xsltproc libxslt1-dev
47+
git clone -b $PG_BRANCH --depth=1 --single-branch https://.com/postgres/postgres.git $_WORKSPACE/../pg
48+
cd $_WORKSPACE/../pg
49+
cp -r ../aqo contrib/aqo
50+
-p1 --no-backup-if-mismatch < contrib/aqo/$CORE__NAME
4951
5052
- name: "Paths"
5153
run: |
52-
echo "$_WORKSPACE/pg/contrib/aqo/./scripts/job" >> $_PATH
53-
ls -la pg/contrib/aqo/./scripts/job
54-
echo "$_WORKSPACE/pg/tmp_install/bin" >> $_PATH
54+
cd $_WORKSPACE/../pg
55+
echo "COPT=-Werror" >> $_ENV
56+
echo "CONFIGURE_OPTS=--prefix=`pwd`/tmp_install --enable-tap-tests --enable-cassert" >> $_ENV
57+
echo "$_WORKSPACE/../pg/tmp_install/bin" >> $_PATH
58+
echo "$_WORKSPACE/../pg/contrib/aqo/./scripts/job" >> $_PATH
5559
echo "LD_LIBRARY_PATH=$_WORKSPACE/pg/tmp_install/lib" >> $_ENV
5660
echo "PGDATABASE=`whoami`" >> $_ENV
5761
echo "PGHOST=localhost" >> $_ENV
5862
echo "PGDATA=PGDATA" >> $_ENV
5963
echo "PGUSER=`whoami`" >> $_ENV
6064
echo "PGPORT=5432" >> $_ENV
6165
62-
- name: "Debug"
63-
run: |
64-
echo "paths: $PATH"
65-
echo "PG_MAJOR_VERSION: $PG_MAJOR_VERSION, CORE_BRANCH_NAME: $CORE_BRANCH_NAME, AQO__NAME: $AQO__NAME, CONFIGURE_OPTS: $CONFIGURE_OPTS"
66-
6766
- name: "Compilation"
6867
run: |
69-
cd pg
70-
./configure $CONFIGURE_OPTS CFLAGS="-O2"
68+
cd $_WORKSPACE/../pg
69+
echo "paths: $PATH"
70+
echo "COPT: $COPT"
71+
echo "CONFIGURE_OPTS: $CONFIGURE_OPTS"
72+
./configure $CONFIGURE_OPTS CFLAGS="-O2" > /dev/null
7173
make -j4 > /dev/null && make -j4 -C contrib > /dev/null
7274
make install >> make.log && make -C contrib install > /dev/null
7375
7476
- name: "Launch AQO instance"
7577
run: |
76-
cd pg
78+
cd $_WORKSPACE/../pg
7779
7880
# Launch an instance with AQO extension
7981
aqo_instance_launch.sh
@@ -84,29 +86,29 @@ jobs:
8486
# Pass installcheck in disabled mode
8587
- name: installcheck_disabled
8688
run: |
87-
cd pg
89+
cd $_WORKSPACE/../pg
8890
psql -c "ALTER SYSTEM SET aqo.force_collect_stat = 'off'"
8991
psql -c "SELECT pg_reload_conf()"
9092
make installcheck-world
9193
9294
- name: installcheck_disabled_forced_stat
9395
run: |
94-
cd pg
96+
cd $_WORKSPACE/../pg
9597
psql -c "ALTER SYSTEM SET aqo.force_collect_stat = 'on'"
9698
psql -c "SELECT pg_reload_conf()"
9799
make installcheck-world
98100
99101
- name: installcheck_frozen
100102
run: |
101-
cd pg
103+
cd $_WORKSPACE/../pg
102104
psql -c "ALTER SYSTEM SET aqo.mode = 'frozen'"
103105
psql -c "ALTER SYSTEM SET aqo.force_collect_stat = 'on'"
104106
psql -c "SELECT pg_reload_conf()"
105107
make installcheck-world
106108
107109
- name: installcheck_controlled
108110
run: |
109-
cd pg
111+
cd $_WORKSPACE/../pg
110112
psql -c "ALTER SYSTEM SET aqo.mode = 'controlled'"
111113
psql -c "ALTER SYSTEM SET aqo.force_collect_stat = 'on'"
112114
psql -c "SELECT pg_reload_conf()"
@@ -115,7 +117,7 @@ jobs:
115117
- name: installcheck_learn
116118
continue-on-error: true
117119
run: |
118-
cd pg
120+
cd $_WORKSPACE/../pg
119121
psql -c "ALTER SYSTEM SET aqo.mode = 'learn'"
120122
psql -c "ALTER SYSTEM SET aqo.force_collect_stat = 'on'"
121123
psql -c "SELECT pg_reload_conf()"
@@ -124,7 +126,7 @@ jobs:
124126
- name: installcheck_intelligent
125127
continue-on-error: true
126128
run: |
127-
cd pg
129+
cd $_WORKSPACE/../pg
128130
psql -c "ALTER SYSTEM SET aqo.mode = 'intelligent'"
129131
psql -c "ALTER SYSTEM SET aqo.force_collect_stat = 'on'"
130132
psql -c "SELECT pg_reload_conf()"
@@ -133,18 +135,18 @@ jobs:
133135
- name: installcheck_forced
134136
continue-on-error: true
135137
run: |
136-
cd pg
138+
cd $_WORKSPACE/../pg
137139
psql -c "ALTER SYSTEM SET aqo.mode = 'forced'"
138140
psql -c "ALTER SYSTEM SET aqo.force_collect_stat = 'on'"
139141
psql -c "SELECT pg_reload_conf()"
140142
make -k installcheck-world
141143
142144
# Save Artifacts
143145
- name: Archive artifacts
144-
if: ${{ failure() }}
146+
if: ${{ always() }}
145147
uses: actions/upload-artifact@v3
146148
with:
147-
name: ${{ env.AQO_VERSION }}-${{ env.CORE_BRANCH_NAME }}-${{ env.BRANCH_NAME }}-artifacts
149+
name: ${{ env.AQO_VERSION }}-${{ env.PG_BRANCH }}-${{ env.CORE__NAME }}-artifacts
148150
path: |
149151
pg/src/test/regress/regression.diffs
150152
pg/logfile.log

‎regress_schedule

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ test: plancache
1515
test: update_functions
1616
# Performance-dependent test. Can be ignored if executes in containers or on slow machines
1717
ignore: statement_timeout
18+
test: statement_timeout
1819
test: temp_tables
1920
test: top_queries
2021
test: relocatable

0 commit comments

Comments
 (0)