<commit_before>sudo: false
language: java
dist: trusty

branches:
  except:
    - /^tmp\/.*/
    - /^REL.*/

stages:
  - name: test
    if: not branch =~ ^release\/.*$
  - name: release
    # releases pgjdbc for Java 8
    # It does set release tag and update pom.xml versions
    if: branch =~ ^release\/.*$
  - name: release_prev
    # releases pgjdbc for Java 6, Java 7
    # pgjdbc-jreX requires release pom.xml versions of the main project, so pgjdbc-jreX should be
    # released after the release of the main version, thus second stage
    if: branch =~ ^release\/.*$

before_script:
  - test $(grep "after_n_builds" codecov.yml | tr -d '[:space:]' | cut -d":" -f2) -eq $(grep -e "COVERAGE=Y$" .travis.yml | wc -l) || exit 1
  - export PG_DATADIR="/etc/postgresql/${PG_VERSION}/main"
  - export PG_SLAVE1_DATADIR="/etc/postgresql/${PG_VERSION}/slave1"
  - export PG_SLAVE2_DATADIR="/etc/postgresql/${PG_VERSION}/slave2"
  -  ./.travis/travis_install_postgres.sh
  - test "x$XA" == 'x' || ./.travis/travis_configure_xa.sh
  - test "x$REPLICATION" == 'x' || ./.travis/travis_configure_replication.sh
  - test "x$SSLTEST" == 'x' || ./.travis/travis_configure_ssl.sh
  - ./.travis/travis_start_postgres.sh
  - test "x$PG_VERSION" != 'xHEAD' || psql -U postgres -c "set password_encryption='scram-sha-256'; create user test with password '<PASSWORD>';"
  - test "x$PG_VERSION" = 'xHEAD' || psql -U postgres -c "create user test with password '<PASSWORD>';"
  - test "x$REPLICATION" == 'x' || psql -U postgres -c "alter user test with replication;"
  - psql -c 'create database test owner test;' -U postgres
  - test "x$SSLTEST" == 'x' || ./.travis/travis_ssl_users.sh
  - test "x$REPLICATION" == 'x' || ./.travis/travis_create_slaves.sh
  - if [[ $TRAVIS_BRANCH == release/* ]]; then echo "MAVEN_OPTS='-Xmx1g'" > ~/.mavenrc; else echo "MAVEN_OPTS='-Xmx1g -Dgpg.skip=true'" > ~/.mavenrc; fi
  - test "x$PG_VERSION" == 'x' || test "x$NO_HSTORE" == 'xY' || psql test -c 'CREATE EXTENSION hstore;' -U postgres
  - test "x$PG_VERSION" == 'x' || test "x$CREATE_PLPGSQL" == 'x' || createlang -U postgres plpgsql test

env:
  global:
    - secure: "<KEY>

before_install:
  - ./.travis/travis_install_zulu.sh
  - test -z "${ZULU_JDK}" || export JDK${ZULU_JDK}_HOME=/usr/lib/jvm/zulu-${ZULU_JDK}-amd64

script:
  # make sure previous build artifacts are not used for subsequent builds
  - rm -rf $HOME/.m2/repository/org/postgresql || true
  - test -d "${JDK6_HOME}" || export JDK6_HOME=$(jdk_switcher home openjdk6)
  - test -d "${JDK7_HOME}" || export JDK7_HOME=$(jdk_switcher home openjdk7)
  - test -d "${JDK8_HOME}" || export JDK8_HOME=$(jdk_switcher home oraclejdk8)
  - test -d "${JDK9_HOME}" || export JDK9_HOME=$(jdk_switcher home oraclejdk9)<commit_msg>chore: suppress Picked up _JAVA_OPTIONS warnings<commit_after>sudo: false
language: java
dist: trusty

branches:
  except:
    - /^tmp\/.*/
    - /^REL.*/

stages:
  - name: test
    if: not branch =~ ^release\/.*$
  - name: release
    # releases pgjdbc for Java 8
    # It does set release tag and update pom.xml versions
    if: branch =~ ^release\/.*$
  - name: release_prev
    # releases pgjdbc for Java 6, Java 7
    # pgjdbc-jreX requires release pom.xml versions of the main project, so pgjdbc-jreX should be
    # released after the release of the main version, thus second stage
    if: branch =~ ^release\/.*$

before_script:
  - test $(grep "after_n_builds" codecov.yml | tr -d '[:space:]' | cut -d":" -f2) -eq $(grep -e "COVERAGE=Y$" .travis.yml | wc -l) || exit 1
  - export PG_DATADIR="/etc/postgresql/${PG_VERSION}/main"
  - export PG_SLAVE1_DATADIR="/etc/postgresql/${PG_VERSION}/slave1"
  - export PG_SLAVE2_DATADIR="/etc/postgresql/${PG_VERSION}/slave2"
  -  ./.travis/travis_install_postgres.sh
  - test "x$XA" == 'x' || ./.travis/travis_configure_xa.sh
  - test "x$REPLICATION" == 'x' || ./.travis/travis_configure_replication.sh
  - test "x$SSLTEST" == 'x' || ./.travis/travis_configure_ssl.sh
  - ./.travis/travis_start_postgres.sh
  - test "x$PG_VERSION" != 'xHEAD' || psql -U postgres -c "set password_encryption='scram-sha-256'; create user test with password '<PASSWORD>';"
  - test "x$PG_VERSION" = 'xHEAD' || psql -U postgres -c "create user test with password '<PASSWORD>';"
  - test "x$REPLICATION" == 'x' || psql -U postgres -c "alter user test with replication;"
  - psql -c 'create database test owner test;' -U postgres
  - test "x$SSLTEST" == 'x' || ./.travis/travis_ssl_users.sh
  - test "x$REPLICATION" == 'x' || ./.travis/travis_create_slaves.sh
  - if [[ $TRAVIS_BRANCH == release/* ]]; then echo "MAVEN_OPTS='-Xmx1g'" > ~/.mavenrc; else echo "MAVEN_OPTS='-Xmx1g -Dgpg.skip=true'" > ~/.mavenrc; fi
  - test "x$PG_VERSION" == 'x' || test "x$NO_HSTORE" == 'xY' || psql test -c 'CREATE EXTENSION hstore;' -U postgres
  - test "x$PG_VERSION" == 'x' || test "x$CREATE_PLPGSQL" == 'x' || createlang -U postgres plpgsql test

env:
  global:
    - secure: "<KEY>

before_install:
  - ./.travis/travis_install_zulu.sh
  - test -z "${ZULU_JDK}" || export JDK${ZULU_JDK}_HOME=/usr/lib/jvm/zulu-${ZULU_JDK}-amd64
  - unset _JAVA_OPTIONS # see https://github.com/travis-ci/travis-ci/issues/8408

script:
  # make sure previous build artifacts are not used for subsequent builds
  - rm -rf $HOME/.m2/repository/org/postgresql || true
  - test -d "${JDK6_HOME}" || export JDK6_HOME=$(jdk_switcher home openjdk6)
  - test -d "${JDK7_HOME}" || export JDK7_HOME=$(jdk_switcher home openjdk7)
  - test -d "${JDK8_HOME}" || export JDK8_HOME=$(jdk_switcher home oraclejdk8)
  - test -d "${JDK9_HOME}" || export JDK9_HOME=$(jdk_switcher home oraclejdk9)
{'fraction_non_alphanumeric': 0.1689765458422175, 'fraction_numerical': 0.01101634683724236, 'mean_word_length': 3.5615883306320906, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3889619', 'n_tokens_mistral': 2258, 'n_tokens_neox': 2225, 'n_words': 532}