Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save macdice/45ec1ddce92f7fe55a73cf56be03755a to your computer and use it in GitHub Desktop.
Save macdice/45ec1ddce92f7fe55a73cf56be03755a to your computer and use it in GitHub Desktop.
From 6e4025dc7d5a1f9866689e1e73b0bf2fe6b12dd7 Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.munro@enterprisedb.com>
Date: Fri, 1 Jun 2018 02:02:30 -0400
Subject: [PATCH] Add CI control files for Travis and AppVeyor.
This commit is not intended to be part of a patch submission, it's just a way
to trigger builds on Travis and/or AppVeyor. Push a PostgreSQL source tree
to GitHub including this commit, after enabling travis-ci.org and/or
appveyor.com to watch your GitHub repo and build any branch containing
.travis.yml/appveyor.yml.
This is a good way to find out what will happen on cfbot.cputube.org after
you post a patch to the pgsql-hackers mailing list in a thread that is
registered in commitfest.postgresql.org.
Add described at https://wiki.postgresql.org/wiki/Continuous_Integration .
---
.travis.yml | 33 +++++++++++++++++++++++++++++++++
appveyor.yml | 25 +++++++++++++++++++++++++
buildsetup.pl | 38 ++++++++++++++++++++++++++++++++++++++
dumpregr.pl | 20 ++++++++++++++++++++
4 files changed, 116 insertions(+)
create mode 100644 .travis.yml
create mode 100644 appveyor.yml
create mode 100644 buildsetup.pl
create mode 100644 dumpregr.pl
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000000..c5e05f5950
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,33 @@
+sudo: required
+addons:
+ apt:
+ packages:
+ - gdb
+ - lcov
+ - libipc-run-perl
+ - libperl-dev
+ - libpython-dev
+ - tcl-dev
+ - libldap2-dev
+ - libicu-dev
+ - docbook
+ - docbook-dsssl
+ - docbook-xsl
+ - libxml2-utils
+ - openjade1.3
+ - opensp
+ - xsltproc
+language: c
+cache: ccache
+before_install:
+ - echo '/tmp/%e-%s-%p.core' | sudo tee /proc/sys/kernel/core_pattern
+script: ./configure --enable-debug --enable-cassert --enable-tap-tests --with-tcl --with-python --with-perl --with-ldap --with-icu && make -j4 all contrib docs && make check-world
+after_failure:
+ - for f in $(find . -name regression.diffs) ; do echo "========= Contents of $f" ; head -1000 $f ; done
+ - |
+ for corefile in $(find /tmp/ -name '*.core' 2>/dev/null) ; do
+ binary=$(gdb -quiet -core $corefile -batch -ex 'info auxv' | grep AT_EXECFN | perl -pe "s/^.*\"(.*)\"\$/\$1/g")
+ echo dumping $corefile for $binary
+ gdb --batch --quiet -ex "thread apply all bt full" -ex "quit" $binary $corefile
+ done
+
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 0000000000..04e041ad63
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,25 @@
+# appveyor.yml
+install:
+ - cinst winflexbison
+ - '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64'
+
+before_build:
+ - rename c:\ProgramData\chocolatey\bin\win_flex.exe flex.exe
+ - rename c:\ProgramData\chocolatey\bin\win_bison.exe bison.exe
+ - perl buildsetup.pl
+
+build:
+ project: pgsql.sln
+
+before_test:
+ - 'perl -p -i.bak -e "s/^test: tablespace/#test: tablespace/" src/test/regress/serial_schedule'
+ - 'perl -p -i.bak -e "s/^test: tablespace/#test: tablespace/" src/test/regress/parallel_schedule'
+
+test_script:
+ - cd src\tools\msvc && vcregress check
+
+on_failure:
+ - perl dumpregr.pl
+
+configuration:
+ - Release
diff --git a/buildsetup.pl b/buildsetup.pl
new file mode 100644
index 0000000000..23df2fb1aa
--- /dev/null
+++ b/buildsetup.pl
@@ -0,0 +1,38 @@
+# first part of postgres build.pl, just doesn't run msbuild
+
+use strict;
+
+BEGIN
+{
+
+ chdir("../../..") if (-d "../msvc" && -d "../../../src");
+
+}
+
+use lib "src/tools/msvc";
+
+use Cwd;
+
+use Mkvcbuild;
+
+# buildenv.pl is for specifying the build environment settings
+# it should contain lines like:
+# $ENV{PATH} = "c:/path/to/bison/bin;$ENV{PATH}";
+
+if (-e "src/tools/msvc/buildenv.pl")
+{
+ do "src/tools/msvc/buildenv.pl";
+}
+elsif (-e "./buildenv.pl")
+{
+ do "./buildenv.pl";
+}
+
+# set up the project
+our $config;
+do "config_default.pl";
+do "config.pl" if (-f "src/tools/msvc/config.pl");
+
+# print "PATH: $_\n" foreach (split(';',$ENV{PATH}));
+
+Mkvcbuild::mkvcbuild($config);
diff --git a/dumpregr.pl b/dumpregr.pl
new file mode 100644
index 0000000000..08d276b52d
--- /dev/null
+++ b/dumpregr.pl
@@ -0,0 +1,20 @@
+use strict;
+use warnings FATAL => qw(all);
+
+use File::Find;
+
+my $Target = "regression.diffs";
+
+find(\&dump, "src");
+
+sub dump {
+ if ($_ eq $Target) {
+ my $path = $File::Find::name;
+ print "=== \$path ===\\n";
+ open(my $fh, "<", $_) || die "wtf";
+ while (my $line = <$fh>) {
+ print $line;
+ if ($. > 1000) { last; }
+ }
+ }
+}
--
2.17.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment