Skip to content

Commit

Permalink
Build and test on Travis without Docker
Browse files Browse the repository at this point in the history
Install postgresql packages from the PGDG apt repo.
  • Loading branch information
Sergey Shinderuk committed Oct 20, 2023
1 parent bf6bc4b commit b8037cf
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 136 deletions.
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.deps
*.o
*.so
/results
.log
Dockerfile
/.deps/
/log/
/results/
/tmp_check/
46 changes: 17 additions & 29 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,20 @@
os:
- linux

sudo: required
dist: jammy

language: c

services:
- docker

install:
- sed -e 's/${CHECK_CODE}/'${CHECK_CODE}/g -e 's/${PG_VERSION}/'${PG_VERSION}/g Dockerfile.tmpl > Dockerfile
- docker-compose build

script:
- docker-compose run tests

env:
- PG_VERSION=11 CHECK_CODE=clang
- PG_VERSION=11 CHECK_CODE=cppcheck
- PG_VERSION=11 CHECK_CODE=false
- PG_VERSION=12 CHECK_CODE=clang
- PG_VERSION=12 CHECK_CODE=false
- PG_VERSION=13 CHECK_CODE=clang
- PG_VERSION=13 CHECK_CODE=false
- PG_VERSION=14 CHECK_CODE=clang
- PG_VERSION=14 CHECK_CODE=false
- PG_VERSION=15 CHECK_CODE=clang
- PG_VERSION=15 CHECK_CODE=false
- PG_VERSION=16 CHECK_CODE=clang
- PG_VERSION=16 CHECK_CODE=false
- PG_MAJOR=16
- PG_MAJOR=15
- PG_MAJOR=14
- PG_MAJOR=13
- PG_MAJOR=12
- PG_MAJOR=11
before_script:
- curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
- echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" | sudo tee -a /etc/apt/sources.list
- sudo apt-get update
- sudo systemctl stop postgresql
- sudo apt-get install -y --no-install-recommends postgresql-${PG_MAJOR} postgresql-server-dev-${PG_MAJOR}
- sudo systemctl stop postgresql
script: ./run-tests.sh
after_script:
- cat regression.diffs
- cat logfile
34 changes: 0 additions & 34 deletions Dockerfile.tmpl

This file was deleted.

2 changes: 0 additions & 2 deletions docker-compose.yml

This file was deleted.

22 changes: 22 additions & 0 deletions run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -ev

PATH=/usr/lib/postgresql/$PG_MAJOR/bin:$PATH
export PGDATA=/var/lib/postgresql/$PG_MAJOR/test
export COPT=-Werror
export USE_PGXS=1

sudo chmod 1777 /var/lib/postgresql/$PG_MAJOR
sudo chmod 1777 /var/run/postgresql

make clean
make

sudo -E env PATH=$PATH make install

initdb
echo "shared_preload_libraries = pg_wait_sampling" >> $PGDATA/postgresql.conf

pg_ctl -l logfile start
make installcheck
pg_ctl stop
67 changes: 0 additions & 67 deletions run_tests.sh

This file was deleted.

0 comments on commit b8037cf

Please sign in to comment.