Skip to content

Commit a14bf6d

Browse files
committed
Generalize basic CI script
reviewed-by: a.rybakina
1 parent f84caae commit a14bf6d

File tree

1 file changed

+52
-30
lines changed

1 file changed

+52
-30
lines changed

.github/workflows/c-cpp.yml

Lines changed: 52 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
name: 'C/C++ CI for the stable13'
1+
name: 'AQO basic CI'
22

33
on:
4-
push:
5-
branches: [ stable13 ]
64
pull_request:
7-
branches: [ stable13 ]
85

96
env:
107
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
@@ -15,45 +12,70 @@ jobs:
1512
runs-on: ubuntu-latest
1613

1714
steps:
18-
- name: pg
15+
- uses: actions/checkout@v3
16+
- name: "Define PostreSQL major version"
1917
run: |
20-
sudo apt install libipc-run-perl
18+
echo "$(ls -la)"
19+
patch_name=$(ls aqo_*.patch|tail -1)
20+
echo "CORE_PATCH_NAME=$patch_name" >> $GITHUB_ENV
21+
22+
# we can get number, otherwise set up master
23+
vers_number=$(echo "$patch_name"|tr -d -c 0-9)
24+
echo "PG_MAJOR_VERSION=$vers_number" >> $GITHUB_ENV
25+
26+
branch_name="REL_${vers_number}_STABLE"
27+
echo "PG_BRANCH=$branch_name" >> $GITHUB_ENV
28+
29+
echo "COPT=-Werror" >> $GITHUB_ENV
30+
echo "CONFIGURE_OPTS=--prefix=`pwd`/tmp_install --enable-tap-tests --enable-cassert" >> $GITHUB_ENV
31+
32+
- name: "Set master branch name, if needed"
33+
if: env.PG_MAJOR_VERSION == ''
34+
run: |
35+
branch_name="master"
36+
echo "PG_BRANCH=$branch_name" >> $GITHUB_ENV
2137
22-
echo "Deploying to production server on branch" $BRANCH_NAME
38+
- name: "Environment (debug output)"
39+
if: ${{ always() }}
40+
run: |
41+
echo "Use PostgreSQL branch $PG_BRANCH (patch: $CORE_PATCH_NAME)"
42+
echo "COPT: $COPT"
43+
echo "CONFIGURE_OPTS: $CONFIGURE_OPTS"
44+
echo "Deploying to production server on branch" $BRANCH_NAME "(PG $PG_BRANCH)"
2345
git config --global user.email "ci@postgrespro.ru"
2446
git config --global user.name "CI PgPro admin"
25-
export COPT=-Werror
26-
export CONFIGURE_OPTS="--prefix=`pwd`/tmp_install --enable-tap-tests --enable-cassert"
27-
git clone https://github.com/postgres/postgres.git pg
28-
cd pg
29-
30-
git checkout REL_13_STABLE
31-
git clone https://github.com/postgrespro/aqo.git contrib/aqo
32-
git -C contrib/aqo checkout $BRANCH_NAME
33-
patch -p1 --no-backup-if-mismatch < contrib/aqo/aqo_pg13.patch
34-
./configure $CONFIGURE_OPTS CFLAGS="-O2"
47+
48+
- name: "Prepare PG directory"
49+
run: |
50+
git clone -b $PG_BRANCH --depth=1 --single-branch https://github.com/postgres/postgres.git $GITHUB_WORKSPACE/../pg
51+
cd $GITHUB_WORKSPACE/../pg
52+
ls -la
53+
cp -r ../aqo contrib/aqo
54+
patch -p1 --no-backup-if-mismatch < contrib/aqo/$CORE_PATCH_NAME
55+
56+
- name: "make check"
57+
run: |
58+
sudo apt install libipc-run-perl
59+
60+
cd $GITHUB_WORKSPACE/../pg
61+
./configure $CONFIGURE_OPTS CFLAGS="-O2" > /dev/null
3562
make -j4 > /dev/null && make -j4 -C contrib > /dev/null
3663
env CLIENTS=50 THREADS=50 make -C contrib/aqo check
3764
3865
echo "Use AQO with debug code included"
3966
git clean -fdx
4067
git -C contrib/aqo clean -fdx
41-
./configure $CONFIGURE_OPTS CFLAGS="-DAQO_DEBUG_PRINT -O0"
68+
./configure $CONFIGURE_OPTS CFLAGS="-DAQO_DEBUG_PRINT -O0" > /dev/null
4269
make -j4 > /dev/null && make -j4 -C contrib > /dev/null
4370
env CLIENTS=50 THREADS=50 make -C contrib/aqo check
44-
- name: Archive regression.diffs
45-
if: ${{ always() }}
46-
uses: actions/upload-artifact@v3
47-
with:
48-
name: regression_diffs
49-
path: /home/runner/work/aqo/aqo/pg/contrib/aqo/regression.diffs
50-
retention-days: 1
51-
- name: Archive TAP tests log files
71+
72+
- name: Archive artifacts
5273
if: ${{ always() }}
5374
uses: actions/upload-artifact@v3
5475
with:
55-
name: tap_logs
76+
name: make_check_logs
5677
path: |
57-
log
58-
retention-days: 1
59-
78+
/home/runner/work/aqo/pg/contrib/aqo/regression.diffs
79+
/home/runner/work/aqo/pg/contrib/aqo/log
80+
/home/runner/work/aqo/pg/contrib/aqo/tmp_check/log
81+
retention-days: 7

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy