Fix ident quoting in SELECT statement #98
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
# | |
# https://docs.github.com/en/actions | |
# https://github.com/actions | |
# https://hub.docker.com/r/pgxn/pgxn-tools | |
# | |
# mac: https://brew.sh/ | |
# win: https://www.msys2.org/docs/package-management/ | |
# win: https://www.archlinux.org/pacman/pacman.8.html | |
# | |
name: CI | |
on: | |
pull_request: {} | |
push: {} | |
jobs: | |
test: | |
name: ${{matrix.test.os}}, pg-${{matrix.test.pgver}} | |
runs-on: ${{matrix.test.os}} | |
strategy: | |
matrix: | |
test: | |
- {pgver: "9.4", os: "ubuntu-latest"} | |
- {pgver: "9.5", os: "ubuntu-latest"} | |
- {pgver: "9.6", os: "ubuntu-latest"} | |
- {pgver: "10", os: "ubuntu-latest"} | |
- {pgver: "11", os: "ubuntu-latest"} | |
- {pgver: "12", os: "ubuntu-latest"} | |
- {pgver: "13", os: "ubuntu-latest"} | |
- {pgver: "14", os: "ubuntu-latest"} | |
- {pgver: "15", os: "ubuntu-latest"} | |
- {pgver: "16", os: "ubuntu-latest"} | |
- {pgver: "14", os: "macos-latest"} | |
- {pgver: "15", os: "macos-latest"} | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "InstallDB / Linux" | |
if: ${{runner.os == 'Linux'}} | |
run: | | |
echo "::group::apt-get-update" | |
sudo -nH apt-get -q update | |
sudo -nH apt-get -q install curl ca-certificates gnupg | |
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc \ | |
| gpg --dearmor \ | |
| sudo -nH tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg | |
echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main ${{matrix.test.PG}}" \ | |
| sudo -nH tee /etc/apt/sources.list.d/pgdg.list | |
sudo -nH apt-get -q update | |
echo "::endgroup::" | |
echo "::group::apt-get-install" | |
# disable new cluster creation | |
sudo -nH mkdir -p /etc/postgresql-common/createcluster.d | |
echo "create_main_cluster = false" | sudo -nH tee /etc/postgresql-common/createcluster.d/no-main.conf | |
sudo -nH apt-get -qyu install \ | |
postgresql-${{matrix.test.pgver}} \ | |
postgresql-server-dev-${{matrix.test.pgver}} \ | |
libpq-dev patchutils | |
echo "::endgroup::" | |
# tune environment | |
echo "/usr/lib/postgresql/${{matrix.test.pgver}}/bin" >> $GITHUB_PATH | |
echo "PGHOST=/tmp" >> $GITHUB_ENV | |
echo "SED=sed" >> $GITHUB_ENV | |
dpkg -l postgres\* libpq\* bison\* flex\* gcc\* clang\* libllvm\* | |
- name: "InstallDB / Mac" | |
if: ${{runner.os == 'macOS'}} | |
run: | | |
echo "::group::install" | |
brew install patchutils bison flex gnu-sed postgresql@${{matrix.test.pgver}} | |
echo "::endgroup::" | |
echo "/usr/local/opt/flex/bin" >> $GITHUB_PATH | |
echo "/usr/local/opt/bison/bin" >> $GITHUB_PATH | |
echo "/usr/local/opt/postgresql@${{matrix.test.pgver}}/bin" >> $GITHUB_PATH | |
echo "SED=gsed" >> $GITHUB_ENV | |
- name: "Build" | |
run: make BISON=bison FLEX=flex | |
- name: "Install" | |
run: sudo -nH bash -c "PATH='${PATH}' make install" | |
- name: "StartDB" | |
run: | | |
mkdir -p log | |
LANG=C LC_ALL=C initdb --no-locale data | |
${SED} -r -i -e "s,^[# ]*(unix_socket_directories).*,\\1='/tmp'," data/postgresql.conf | |
pg_ctl -D data -l log/pg.log start || { cat log/pg.log ; exit 1; } | |
sleep 2 | |
- name: "Test" | |
run: make citest | |
- name: "StopDB" | |
run: | | |
pg_ctl -D data stop | |
rm -rf data log /tmp/.s.PGSQL* | |
mingw: | |
name: ${{matrix.test.os}}, ${{matrix.test.mingw}} | |
runs-on: ${{matrix.test.os}} | |
strategy: | |
matrix: | |
test: | |
#- {os: "windows-latest", arch: i686, mingw: mingw32} | |
- {os: "windows-latest", arch: x86_64, mingw: mingw64} | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "Setup MSYS" | |
shell: cmd | |
run: | | |
echo C:\msys64\usr\bin>> %GITHUB_PATH% | |
echo C:\msys64\${{matrix.test.mingw}}\bin>> %GITHUB_PATH% | |
- name: "InstallDB / mingw / ${{matrix.test.arch}}" | |
shell: bash | |
run: | | |
pacman -S --noconfirm --needed \ | |
flex bison \ | |
mingw-w64-${{matrix.test.arch}}-gettext \ | |
mingw-w64-${{matrix.test.arch}}-postgresql | |
- name: "Build" | |
shell: bash | |
run: | | |
export EXTRA_CPPFLAGS="-fstack-check=no -fno-stack-protector" # enabled by default but broken | |
make FLEX=flex BISON=bison | |
- name: "Install" | |
shell: bash | |
run: make install | |
- name: "StartDB" | |
shell: bash | |
run: | | |
mkdir log | |
initdb.exe --no-locale -U postgres -D data | |
pg_ctl -D data -l log/pg.log start || { cat log/pg.log ; exit 1; } | |
sleep 3 | |
- name: "Test" | |
shell: bash | |
run: make citest | |
- name: "StopDB" | |
shell: bash | |
run: | | |
pg_ctl -D data stop | |
pgxn: | |
name: pgxn-tools, PostgreSQL ${{ matrix.pg }} | |
strategy: | |
matrix: | |
pg: ["16", "14", "10", "9.6"] | |
runs-on: ubuntu-latest | |
container: pgxn/pgxn-tools | |
steps: | |
- name: Start PostgreSQL ${{matrix.pg}} | |
run: LANG=C LC_ALL=C pg-start ${{matrix.pg}} bison flex | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Test on PostgreSQL ${{matrix.pg}} | |
run: pg-build-test | |