Readme fix #74
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: q3c | |
# Run this workflow every time a new commit pushed to your repository | |
on: | |
push: | |
branches: | |
- '*' | |
tags: | |
- '*' | |
pull_request: | |
jobs: | |
tester: | |
name: Test the code | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
container: ['ubuntu:22.04'] | |
compiler: [gcc] | |
PGVERSION: [12, 13, 14, 15, 16, 17] | |
COVERAGE: ['0'] | |
APT: ['1'] | |
include: | |
- APT: '0' | |
COVERAGE: '1' | |
compiler: 'gcc' | |
- APT: '0' | |
COVERAGE: '0' | |
compiler: 'clang' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: PG cleanup | |
run: | | |
sudo apt-get -y --purge remove postgresql libpq-dev libpq5 postgresql-client-common postgresql-common | |
sudo apt-get -y install python3 python3-pip lcov | |
sudo pip install cpp-coveralls | |
sudo rm -rf /var/lib/postgresql | |
- if: ${{ matrix.APT == '1' }} | |
name: PG APT setup | |
run: | | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
sudo sh -c "echo deb http://apt.postgresql.org/pub/repos/apt/ jammy-pgdg main ${{ matrix.PGVERSION }} >> /etc/apt/sources.list.d/postgresql.list" | |
sudo sh -c "echo deb http://apt.postgresql.org/pub/repos/apt/ jammy-pgdg-testing main ${{ matrix.PGVERSION }} >> /etc/apt/sources.list.d/postgresql.list" | |
sudo apt-get update -qq | |
sudo apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::="--force-confnew" install postgresql-${{ matrix.PGVERSION }} postgresql-server-dev-${{ matrix.PGVERSION }} | |
sudo chmod 777 /etc/postgresql/${{ matrix.PGVERSION}}/main/pg_hba.conf | |
sudo echo "local all postgres trust" > /etc/postgresql/${{ matrix.PGVERSION }}/main/pg_hba.conf | |
sudo echo "local all all trust" >> /etc/postgresql/${{ matrix.PGVERSION }}/main/pg_hba.conf | |
sudo echo "host all all 127.0.0.1/32 trust" >> /etc/postgresql/${{ matrix.PGVERSION }}/main/pg_hba.conf | |
sudo echo "host all all ::1/128 trust" >> /etc/postgresql/${{ matrix.PGVERSION }}/main/pg_hba.conf | |
sudo /etc/init.d/postgresql restart | |
createuser -U postgres -s runner | |
- if: ${{ matrix.APT == '0' }} | |
name: PG source setup | |
run: | | |
export CC=${{ matrix.compiler }} | |
wget https://ftp.postgresql.org/pub/source/v14.10/postgresql-14.10.tar.bz2 | |
tar xfj postgresql-14.10.tar.bz2 | |
mv postgresql-14.10 ../ | |
cd ../postgresql-14.10/ | |
if [[ ${{ matrix.COVERAGE }} == 1 ]] ; then ./configure --enable-coverage --prefix=$PWD/../pg_install/ ; else ./configure --prefix=$PWD/../pg_install/ ; fi | |
make install | |
../pg_install/bin/initdb -D ../pg_install/data | |
../pg_install/bin/postgres -D ../pg_install/data & | |
sleep 2 | |
- name: Build q3c | |
run: | | |
if [[ ${{ matrix.APT }} == 0 ]] ; then export PATH=$PWD/../pg_install/bin/:$PATH ; fi | |
if [[ ${{ matrix.COVERAGE }} == 1 ]] ; then export Q3C_NOOPT=1 ; fi | |
make | |
sudo PATH=$PWD/../pg_install/bin/:$PATH make install | |
- name: Test | |
run: | | |
if [[ ${{ matrix.APT }} == 0 ]] ; then export PATH=$PWD/../pg_install/bin/:$PATH ; fi | |
make test | |
- name: UpdateExtension | |
run: | | |
if [[ ${{ matrix.APT }} == 0 ]] ; then export PATH=$PWD/../pg_install/bin/:$PATH ; fi | |
createdb exttest | |
psql -c "create extension q3c version '2.0.0'" exttest | |
psql -c "alter extension q3c update to '2.0.1'" exttest | |
- if: ${{ matrix.COVERAGE == '1' }} | |
name: Coverall | |
run: | | |
export TRAVIS_JOB_ID=$GITHUB_RUN_ID | |
cpp-coveralls --verbose --exclude postgres.h --exclude pg_list.h --exclude stdio2.h --exclude dump.c --gcov-options '\-lp' | |
env: | |
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} |