-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
104 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
version: 2.1 | ||
|
||
jobs: | ||
build: | ||
docker: | ||
- {image: 'citusdata/extbuilder:debug'} | ||
shell: /bin/bash -euxo pipefail | ||
environment: | ||
IFS: $'\n\t' | ||
steps: | ||
- run: | ||
name: 'Create workspace' | ||
command: | | ||
mkdir -p ./workspace/install "${HOME}/build" | ||
- {checkout: {path: './workspace/src'}} | ||
- run: | ||
name: 'Build' | ||
command: | | ||
pushd ./workspace/src | ||
mkdir ./debian | ||
echo '10 | ||
11' > ./debian/pgversions | ||
export CFLAGS='-Werror -ggdb -Og' | ||
makeflags="-j$(nproc)" | ||
pg_buildext -m "${makeflags}" install "${HOME}/build/pgsql-%v" pgsql-%v | ||
popd | ||
mv ./workspace/src/debian/pgsql-* ./workspace/install | ||
rm -rf .workspace/src/.git .workspace/src/debian | ||
- {persist_to_workspace: {root: './workspace', paths: [.]}} | ||
test: | ||
docker: | ||
- {image: 'citusdata/exttester-10:reporting'} | ||
working_directory: /home/circleci/project | ||
shell: /bin/bash -euxo pipefail | ||
environment: | ||
IFS: $'\n\t' | ||
steps: | ||
- {attach_workspace: {at: ./workspace}} | ||
- run: | ||
name: 'Install extension' | ||
command: | | ||
apt-get update | ||
apt-get install -y --no-install-recommends libprotobuf-c1 locales-all bc | ||
cp -R ./workspace/install/pgsql-${PG_MAJOR}/* / | ||
chown -R circleci:circleci /home/circleci | ||
- run: | ||
name: 'Run tests' | ||
shell: /usr/local/bin/gosu circleci /bin/bash -euxo pipefail | ||
command: | | ||
SRC_DIR="$(pwd)/workspace/src" | ||
echo 'shared_preload_libraries=cstore_fdw' > /tmp/postgres-extra.conf | ||
ulimit -c unlimited | ||
REGRESS_OPTS="--temp-instance=${HOME}/tmp_check --launcher=${SRC_DIR}/log_test_times --temp-config=/tmp/postgres-extra.conf" | ||
if [ -z ${PGXS_SCHEDULE+x} ]; then | ||
SUITE_NAME='regress' | ||
else | ||
SUITE_NAME=$(basename "${PGXS_SCHEDULE%.*}") | ||
REGRESS_OPTS="${REGRESS_OPTS} --schedule=${PGXS_SCHEDULE}" | ||
fi | ||
export OUTPUT_DIR="${SRC_DIR}/${SUITE_NAME}-results" | ||
REGRESS_OPTS="${REGRESS_OPTS} --outputdir=${OUTPUT_DIR}" | ||
mkdir -p "${OUTPUT_DIR}/{sql,expected}" | ||
export REGRESS_OPTS | ||
export PG_CONFIG="/usr/lib/postgresql/${PG_MAJOR}/bin/pg_config" | ||
export PG_REGRESS_DIFF_OPTS='-dU3 -w' | ||
pushd "${SRC_DIR}" | ||
start_time=$(date +%s.%N) | ||
echo "began $(date -d @${start_time} --iso-8601=s)" | ||
status=0 | ||
echo "inputdir ${SRC_DIR}" | ||
make installcheck || status=$? | ||
end_time=$(date +%s.%N) | ||
echo "ended $(date -d @${end_time} --iso-8601=s)" | ||
echo "elapsed $(bc -d ${end_time}-${start_time})" | ||
exit $status | ||
workflows: | ||
version: 2 | ||
build_and_test: | ||
jobs: | ||
- build | ||
- {test: {requires: [build]}} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
export TIMEFORMAT="${PGAPPNAME/#pg_regress\//} %6R" | ||
|
||
OUTPUT_DIR="${OUTPUT_DIR}:-.}" | ||
|
||
{ { time "$@" 1>&3- 2>&4-; } 2>> "${OUTPUT_DIR}/timing.txt"; } 3>&1 4>&2 |