Skip to content

Commit

Permalink
Simplify and fix GitHub workflow
Browse files Browse the repository at this point in the history
Run the regression tests on PG 12 .. 16

Use the actual associated branch rather than the project default branch
  • Loading branch information
df7cb authored and rjuju committed Jan 19, 2025
1 parent a073869 commit abf9da3
Showing 1 changed file with 40 additions and 73 deletions.
113 changes: 40 additions & 73 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright (c) 2023, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
#
#
name: CI

on:
Expand All @@ -12,81 +12,48 @@ on:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10

defaults:
run:
shell: sh

strategy:
fail-fast: false
# Target version of PostgreSQL
matrix:
version: [13, 14, 15]
version:
- 16
- 15
- 14
- 13
- 12

env:
PGVERSION: ${{ matrix.version }}
PGHOME: /home/runner/work/pg_store_plans/pg_store_plans/postgres-dev/${{ matrix.version }}
PGDATA: /home/runner/work/pg_store_plans/pg_store_plans/postgres-dev/${{ matrix.version }}/pg_data

steps:
- name: Get system info
run: |
hostname
whoami
lscpu
free
df -h
uname -a
gcc --version
pwd
- name: Build PostgreSQL and pg_stat_statements
run: |
psql --version
sudo service postgresql stop
sudo apt-get -y --purge remove postgresql libpq-dev libpq5 postgresql-client-common postgresql-common
sudo apt-get -y install bc libpam-dev libedit-dev
echo "### ${PGVERSION} ###"
echo "### $PATH ###"
git clone https://github.com/postgres/postgres.git postgres-dev
cd postgres-dev
git checkout -b REL_${PGVERSION}_STABLE origin/REL_${PGVERSION}_STABLE
./configure -q --prefix=${PGHOME} --enable-debug --enable-cassert
make -s -j 2
make -s install
make -s -C contrib/pg_stat_statements
make -s -C contrib/pg_stat_statements install

export PATH=$PATH:${PGHOME}/bin
echo "### $PATH ###"
mkdir -p ${PGDATA}
initdb --no-locale --encoding=UTF8 -D ${PGDATA}
pg_ctl -V
pg_ctl -D ${PGDATA} start
psql -V
psql -l
psql -c "select 1;" postgres
echo "${PGHOME}/bin" >> $GITHUB_PATH
- name: Build pg_store_plans
run: |
echo "### $PGVERSION ###"
pwd
git clone https://github.com/ossc-db/pg_store_plans.git
cd pg_store_plans
pwd
pg_config
make -s USE_PGXS=1 all install
- name: Startup PostgreSQL
run: |
echo "### $PGVERSION ###"
echo "shared_preload_libraries = 'pg_store_plans, pg_stat_statements'" >> $PGDATA/postgresql.conf
pg_ctl -V
pg_ctl -D $PGDATA restart
- name: Regression test
run: |
echo "### $PGVERSION ###"
psql -V
cd pg_store_plans
make USE_PGXS=1 installcheck
steps:
- name: checkout
uses: actions/checkout@v4

- name: install pg
run: |
sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -v $PGVERSION -p -i
sudo -u postgres createuser -s "$USER"
- name: build
run: |
make PROFILE="-Werror" USE_PGXS=1
sudo -E make install USE_PGXS=1
- name: configure shared_preload_libraries
run: |
psql -c 'alter system set shared_preload_libraries = pg_stat_statements, pg_store_plans' postgres
sudo service postgresql restart
- name: test
run: |
make installcheck USE_PGXS=1
- name: show regression diffs
if: ${{ failure() }}
run: |
cat regression.diffs

0 comments on commit abf9da3

Please sign in to comment.