From abf9da31c925ebd6f882a12013e00cb065a4f53b Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Tue, 3 Sep 2024 14:10:42 +0200 Subject: [PATCH] Simplify and fix GitHub workflow Run the regression tests on PG 12 .. 16 Use the actual associated branch rather than the project default branch --- .github/workflows/main.yml | 113 +++++++++++++------------------------ 1 file changed, 40 insertions(+), 73 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0aeef9e..377421f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,6 @@ # # Copyright (c) 2023, NIPPON TELEGRAPH AND TELEPHONE CORPORATION -# +# name: CI on: @@ -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