########################################
# Evergreen Template for MongoDB Drivers
# Modified for the PHP driver
########################################

# When a task that used to pass starts to fail
# Go through all versions that may have been skipped to detect
# when the task started failing
stepback: true

# Mark a failure as a system/bootstrap failure (purple box) rather then a task
# failure by default.
# Actual testing tasks are marked with `type: test`
command_type: system

# Protect ourself against rogue test case, or curl gone wild, that runs forever
# Good rule of thumb: the averageish length a task takes, times 5
# That roughly accounts for variable system performance for various buildvariants
exec_timeout_secs: 1800 # 6 minutes is the longest we'll ever run

# What to do when evergreen hits the timeout (`post:` tasks are run automatically)
timeout:
  - command: shell.exec
    params:
      script: |
        ls -la

functions:
  "fetch source":
    # Executes git clone and applies the submitted patch, if any
    - command: git.get_project
      params:
        directory: "src"
    # Fetch the libmongoc submodule
    - command: shell.exec
      params:
        working_dir: "src"
        script: |
           git submodule update --init
    # Switch to a different version of libmongoc
    - command: shell.exec
      params:
        working_dir: "src/src/libmongoc"
        script: |
           if [ -n "$LIBMONGOC_VERSION" ]; then
              git fetch
              git checkout $LIBMONGOC_VERSION
              ../../build/calc_release_version.py
           fi
    # Applies the submitted patch, if any
    # Deprecated. Should be removed. But still needed for certain agents (ZAP)
    - command: git.apply_patch
    # Make an evergreen exapanstion file with dynamic values
    - command: shell.exec
      params:
        working_dir: "src"
        script: |
           # Get the current unique version of this checkout
           if [ "${is_patch}" = "true" ]; then
              CURRENT_VERSION=$(git describe)-patch-${version_id}
           else
              CURRENT_VERSION=latest
           fi

           export DRIVERS_TOOLS="$(pwd)/../drivers-tools"
           export PROJECT_DIRECTORY="$(pwd)"

           # Python has cygwin path problems on Windows. Detect prospective mongo-orchestration home directory
           if [ "Windows_NT" = "$OS" ]; then # Magic variable in cygwin
              export DRIVERS_TOOLS=$(cygpath -m $DRIVERS_TOOLS)
              export PROJECT_DIRECTORY=$(cygpath -m $PROJECT_DIRECTORY)
           fi

           export MONGO_ORCHESTRATION_HOME="$DRIVERS_TOOLS/.evergreen/orchestration"
           export MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin"
           export UPLOAD_BUCKET="${project}"

           cat <<EOT > expansion.yml
           CURRENT_VERSION: "$CURRENT_VERSION"
           DRIVERS_TOOLS: "$DRIVERS_TOOLS"
           MONGO_ORCHESTRATION_HOME: "$MONGO_ORCHESTRATION_HOME"
           MONGODB_BINARIES: "$MONGODB_BINARIES"
           UPLOAD_BUCKET: "$UPLOAD_BUCKET"
           PROJECT_DIRECTORY: "$PROJECT_DIRECTORY"
           PREPARE_SHELL: |
              set -o errexit
              set -o xtrace
              export DRIVERS_TOOLS="$DRIVERS_TOOLS"
              export MONGO_ORCHESTRATION_HOME="$MONGO_ORCHESTRATION_HOME"
              export MONGODB_BINARIES="$MONGODB_BINARIES"
              export UPLOAD_BUCKET="$UPLOAD_BUCKET"
              export PROJECT_DIRECTORY="$PROJECT_DIRECTORY"

              export TMPDIR="$MONGO_ORCHESTRATION_HOME/db"
              export PATH="$MONGODB_BINARIES:$PATH"
              export PROJECT="${project}"
           EOT
           # See what we've done
           cat expansion.yml

    # Load the expansion file to make an evergreen variable with the current unique version
    - command: expansions.update
      params:
        file: src/expansion.yml

  "prepare resources":
    - command: shell.exec
      params:
        script: |
          ${PREPARE_SHELL}
          rm -rf $DRIVERS_TOOLS
          if [ "${project}" = "drivers-tools" ]; then
            # If this was a patch build, doing a fresh clone would not actually test the patch
            cp -R ${PROJECT_DIRECTORY}/ $DRIVERS_TOOLS
          else
            git clone git://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS
          fi
          echo "{ \"releases\": { \"default\": \"$MONGODB_BINARIES\" }}" > $MONGO_ORCHESTRATION_HOME/orchestration.config

  "upload release":
    - command: s3.put
      params:
        aws_key: ${aws_key}
        aws_secret: ${aws_secret}
        local_file: ${project}.tar.gz
        remote_file: ${UPLOAD_BUCKET}/${project}-${CURRENT_VERSION}.tar.gz
        bucket: mciuploads
        permissions: public-read
        content_type: ${content_type|application/x-gzip}

  # Upload build artifacts that other tasks may depend on
  # Note this URL needs to be totally unique, while predictable for the next task
  # so it can automatically download the artifacts
  "upload build":
    # Compress and upload the entire build directory
    - command: archive.targz_pack
      params:
        # Example: mongo_c_driver_releng_9dfb7d741efbca16faa7859b9349d7a942273e43_16_11_08_19_29_52.tar.gz
        target: "${build_id}.tar.gz"
        source_dir: ${PROJECT_DIRECTORY}/
        include:
          - "./**"
    - command: s3.put
      params:
        aws_key: ${aws_key}
        aws_secret: ${aws_secret}
        local_file: ${build_id}.tar.gz
        # Example: /mciuploads/${UPLOAD_BUCKET}/gcc49/9dfb7d741efbca16faa7859b9349d7a942273e43/debug-compile-nosasl-nossl/mongo_c_driver_releng_9dfb7d741efbca16faa7859b9349d7a942273e43_16_11_08_19_29_52.tar.gz
        remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${task_name}/${build_id}.tar.gz
        bucket: mciuploads
        permissions: public-read
        content_type: ${content_type|application/x-gzip}

  "fetch build":
    - command: shell.exec
      params:
        continue_on_err: true
        script: "set -o xtrace && rm -rf ${PROJECT_DIRECTORY}"
    - command: s3.get
      params:
        aws_key: ${aws_key}
        aws_secret: ${aws_secret}
        remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${BUILD_NAME}/${build_id}.tar.gz
        bucket: mciuploads
        local_file: build.tar.gz
    - command: shell.exec
      params:
        continue_on_err: true
        # EVG-1105: Use s3.get extract_to: ./
        script: "set -o xtrace && cd .. && rm -rf ${PROJECT_DIRECTORY} && mkdir ${PROJECT_DIRECTORY}/ && tar xf build.tar.gz -C ${PROJECT_DIRECTORY}/"

  "exec compile script" :
    - command: shell.exec
      type: test
      params:
        working_dir: "src"
        script: |
          ${PREPARE_SHELL}
          [ -f ${PROJECT_DIRECTORY}/${file} ] && BUILDTOOL="${buildtool}" sh ${PROJECT_DIRECTORY}/${file} || echo "${PROJECT_DIRECTORY}/${file} not available, skipping"

  "compile driver" :
    - command: shell.exec
      type: test
      params:
        working_dir: "src"
        script: |
          ${PREPARE_SHELL}
          PHP_VERSION=${PHP_VERSION} sh ${PROJECT_DIRECTORY}/.evergreen/compile-unix.sh

  "exec script" :
    - command: shell.exec
      type: test
      params:
        working_dir: "src"
        script: |
          ${PREPARE_SHELL}
          [ -f ${PROJECT_DIRECTORY}/${file} ] && sh ${PROJECT_DIRECTORY}/${file} || echo "${PROJECT_DIRECTORY}/${file} not available, skipping"

  "upload coverage" :
    - command: shell.exec
      params:
        silent: true
        script: |
           export AWS_ACCESS_KEY_ID=${aws_key}
           export AWS_SECRET_ACCESS_KEY=${aws_secret}
           aws s3 cp ${PROJECT_DIRECTORY}/coverage s3://mciuploads/${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/coverage/ --recursive --acl public-read --region us-east-1
    - command: s3.put
      params:
        aws_key: ${aws_key}
        aws_secret: ${aws_secret}
        local_file:  ${PROJECT_DIRECTORY}/coverage/index.html
        remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/coverage/index.html
        bucket: mciuploads
        permissions: public-read
        content_type: text/html
        display_name: "Coverage Report"

  "upload scan artifacts" :
    - command: shell.exec
      type: test
      params:
        script: |
          cd
          if find ${PROJECT_DIRECTORY}/scan -name \*.html | grep -q html; then
            (cd ${PROJECT_DIRECTORY}/scan && find . -name index.html -exec echo "<li><a href='{}'>{}</a></li>" \;) >> scan.html
          else
            echo "No issues found" > scan.html
          fi
    - command: shell.exec
      params:
        silent: true
        script: |
           export AWS_ACCESS_KEY_ID=${aws_key}
           export AWS_SECRET_ACCESS_KEY=${aws_secret}
           aws s3 cp ${PROJECT_DIRECTORY}/scan s3://mciuploads/${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/scan/ --recursive --acl public-read --region us-east-1
    - command: s3.put
      params:
        aws_key: ${aws_key}
        aws_secret: ${aws_secret}
        local_file:  ${PROJECT_DIRECTORY}/scan.html
        remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/scan/index.html
        bucket: mciuploads
        permissions: public-read
        content_type: text/html
        display_name: "Scan Build Report"

  "upload mo artifacts":
    - command: shell.exec
      params:
        script: |
          ${PREPARE_SHELL}
          find $MONGO_ORCHESTRATION_HOME -name \*.log | xargs tar czf mongodb-logs.tar.gz
    - command: s3.put
      params:
        aws_key: ${aws_key}
        aws_secret: ${aws_secret}
        local_file: mongodb-logs.tar.gz
        remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/logs/${task_id}-${execution}-mongodb-logs.tar.gz
        bucket: mciuploads
        permissions: public-read
        content_type: ${content_type|application/x-gzip}
        display_name: "mongodb-logs.tar.gz"
    - command: s3.put
      params:
        aws_key: ${aws_key}
        aws_secret: ${aws_secret}
        local_file: ${DRIVERS_TOOLS}/.evergreen/orchestration/server.log
        remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/logs/${task_id}-${execution}-orchestration.log
        bucket: mciuploads
        permissions: public-read
        content_type: ${content_type|text/plain}
        display_name: "orchestration.log"
    - command: shell.exec
      params:
        script: |
          ${PREPARE_SHELL}
          find /tmp/MO -name \*.log | xargs tar czf mongodb-start-logs.tar.gz
    - command: s3.put
      params:
        aws_key: ${aws_key}
        aws_secret: ${aws_secret}
        local_file: mongodb-start-logs.tar.gz
        remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/logs/${task_id}-${execution}-mongodb-start-logs.tar.gz
        bucket: mciuploads
        permissions: public-read
        content_type: ${content_type|application/x-gzip}
        display_name: "mongodb-start-logs.tar.gz"

  "upload working dir":
    - command: archive.targz_pack
      params:
        target: "working-dir.tar.gz"
        source_dir: ${PROJECT_DIRECTORY}/
        include:
          - "./**"
    - command: s3.put
      params:
        aws_key: ${aws_key}
        aws_secret: ${aws_secret}
        local_file: working-dir.tar.gz
        remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/artifacts/${task_id}-${execution}-working-dir.tar.gz
        bucket: mciuploads
        permissions: public-read
        content_type: ${content_type|application/x-gzip}
        display_name: "working-dir.tar.gz"
    - command: archive.targz_pack
      params:
        target: "drivers-dir.tar.gz"
        source_dir: ${DRIVERS_TOOLS}
        include:
          - "./**"
        exclude_files:
          # Windows cannot read the mongod *.lock files because they are locked.
          - "*.lock"
    - command: s3.put
      params:
        aws_key: ${aws_key}
        aws_secret: ${aws_secret}
        local_file: drivers-dir.tar.gz
        remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/artifacts/${task_id}-${execution}-drivers-dir.tar.gz
        bucket: mciuploads
        permissions: public-read
        content_type: ${content_type|application/x-gzip}
        display_name: "drivers-dir.tar.gz"

  "upload test results":
    - command: attach.results
      params:
        file_location: "${PROJECT_DIRECTORY}/test-results.json"
    - command: attach.results
      params:
        file_location: "${DRIVERS_TOOLS}/results.json"

  "bootstrap mongo-orchestration":
    - command: shell.exec
      params:
        script: |
          ${PREPARE_SHELL}
          MONGODB_VERSION=${VERSION} PROJECT_DIRECTORY=${PROJECT_DIRECTORY} DRIVERS_TOOLS=${DRIVERS_TOOLS} CONFIG=${CONFIG} TOPOLOGY=${TOPOLOGY} APPEND_URI=${APPEND_URI} STORAGE_ENGINE=${STORAGE_ENGINE} sh ${PROJECT_DIRECTORY}/.evergreen/run-orchestration.sh
    # run-orchestration generates expansion file with the MONGODB_URI for the cluster
    - command: expansions.update
      params:
        file: mo-expansion.yml

  "stop mongo-orchestration":
    - command: shell.exec
      params:
        script: |
          ${PREPARE_SHELL}
          sh ${DRIVERS_TOOLS}/.evergreen/stop-orchestration.sh

  "run tests":
    - command: shell.exec
      type: test
      params:
        working_dir: "src"
        script: |
          ${PREPARE_SHELL}
          SSL=${SSL} MONGODB_URI="${MONGODB_URI}" sh ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh

  "cleanup":
    - command: shell.exec
      params:
        script: |
          ${PREPARE_SHELL}
          rm -rf $DRIVERS_TOOLS || true

  "fix absolute paths":
    - command: shell.exec
      params:
        script: |
          ${PREPARE_SHELL}
          for filename in $(find ${DRIVERS_TOOLS} -name \*.json); do
            perl -p -i -e "s|ABSOLUTE_PATH_REPLACEMENT_TOKEN|${DRIVERS_TOOLS}|g" $filename
          done

  "windows fix":
    - command: shell.exec
      params:
        script: |
          ${PREPARE_SHELL}
          for i in $(find ${DRIVERS_TOOLS}/.evergreen ${PROJECT_DIRECTORY}/.evergreen -name \*.sh); do
            cat $i | tr -d '\r' > $i.new
            mv $i.new $i
          done
          # Copy client certificate because symlinks do not work on Windows.
          cp ${PROJECT_DIRECTORY}/scripts/ssl/client.pem ${MONGO_ORCHESTRATION_HOME}/lib/client.pem

  "make files executable":
    - command: shell.exec
      params:
        script: |
          ${PREPARE_SHELL}
          for i in $(find ${DRIVERS_TOOLS}/.evergreen ${PROJECT_DIRECTORY}/.evergreen -name \*.sh); do
            chmod +x $i
          done

  "init test-results":
    - command: shell.exec
      params:
        script: |
          ${PREPARE_SHELL}
          echo '{"results": [{ "status": "FAIL", "test_file": "Build", "log_raw": "No test-results.json found was created"  } ]}' > ${PROJECT_DIRECTORY}/test-results.json

  "install dependencies":
    - command: shell.exec
      params:
        working_dir: "src"
        script: |
          ${PREPARE_SHELL}
          file="${DRIVERS_TOOLS}/.evergreen/install-dependencies.sh"
          # Don't use ${file} syntax here because evergreen treats it as an empty expansion.
          [ -f "$file" ] && sh $file || echo "$file not available, skipping"

pre:
  - func: "fetch source"
  - func: "prepare resources"
  - func: "windows fix"
  - func: "fix absolute paths"
  - func: "init test-results"
  - func: "make files executable"
  - func: "install dependencies"

post:
  - func: "upload working dir"
  - func: "upload mo artifacts"
  - func: "upload test results"
  - func: "stop mongo-orchestration"
  - func: "cleanup"

tasks:


    # Wildcard task. Do you need to find out what tools are available and where?
    # Throw it here, and execute this task on all buildvariants
    - name: getdata
      commands:
        - command: shell.exec
          type: test
          params:
            script: |
               set -o xtrace
               . ${DRIVERS_TOOLS}/.evergreen/download-mongodb.sh || true
               get_distro || true
               echo $DISTRO
               echo $MARCH
               echo $OS
               uname -a || true
               ls /etc/*release* || true
               cc --version || true
               gcc --version || true
               clang --version || true
               gcov --version || true
               lcov --version || true
               llvm-cov --version || true
               echo $PATH
               ls -la /usr/local/Cellar/llvm/*/bin/ || true
               ls -la /usr/local/Cellar/ || true
               scan-build --version || true
               genhtml --version || true
               valgrind --version || true


# Standard test tasks {{{

    - name: "test-standalone"
      tags: ["standalone"]
      commands:
        - func: "compile driver"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "standalone"
            CONFIG: "standalone"
        - func: "run tests"

    - name: "test-standalone-auth"
      tags: ["standalone"]
      commands:
        - func: "compile driver"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "standalone"
            CONFIG: "standalone-auth"
        - func: "run tests"

    - name: "test-standalone-ssl"
      tags: ["standalone"]
      commands:
        - func: "compile driver"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "standalone"
            CONFIG: "standalone-ssl"
        - func: "run tests"
          vars:
            SSL: "yes"

    - name: "test-standalone-old"
      tags: ["standalone"]
      commands:
        - func: "compile driver"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "standalone"
            CONFIG: "standalone-old"
        - func: "run tests"

    - name: "test-replicaset"
      tags: ["replicaset"]
      commands:
        - func: "compile driver"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "replica_sets"
            CONFIG: "replicaset"
        - func: "run tests"

    - name: "test-replicaset-auth"
      tags: ["replicaset"]
      commands:
        - func: "compile driver"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "replica_sets"
            CONFIG: "replicaset-auth"
        - func: "run tests"

    - name: "test-replicaset-single"
      tags: ["replicaset"]
      commands:
        - func: "compile driver"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "replica_sets"
            CONFIG: "replicaset-one-node"
        - func: "run tests"

    - name: "test-replicaset-old"
      tags: ["replicaset"]
      commands:
        - func: "compile driver"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "replica_sets"
            CONFIG: "replicaset-old"
        - func: "run tests"

    - name: "test-sharded"
      tags: ["sharded"]
      commands:
        - func: "compile driver"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "sharded_clusters"
            CONFIG: "cluster"
            APPEND_URI: "/?retryWrites=false"
        - func: "run tests"

    - name: "test-sharded-rs"
      tags: ["sharded"]
      commands:
        - func: "compile driver"
        - func: "bootstrap mongo-orchestration"
          vars:
            TOPOLOGY: "sharded_clusters"
            CONFIG: "cluster_replset"
        - func: "run tests"

# }}}


axes:
  - id: versions
    display_name: MongoDB Version
    values:
      - id: "latest"
        display_name: "MongoDB latest"
        variables:
           VERSION: "latest"
      - id: "4.2"
        display_name: "MongoDB 4.2"
        variables:
           VERSION: "4.2"
      - id: "4.0"
        display_name: "MongoDB 4.0"
        variables:
           VERSION: "4.0"
      - id: "3.6"
        display_name: "MongoDB 3.6"
        variables:
           VERSION: "3.6"
      - id: "3.4"
        display_name: "MongoDB 3.4"
        variables:
           VERSION: "3.4"
      - id: "3.2"
        display_name: "MongoDB 3.2"
        variables:
           VERSION: "3.2"
      - id: "3.0"
        display_name: "MongoDB 3.0"
        variables:
           VERSION: "3.0"

  - id: php-versions
    display_name: PHP Version
    values:
      - id: "7.3"
        display_name: "PHP 7.3"
        variables:
          PHP_VERSION: "7.3.8"
      - id: "7.2"
        display_name: "PHP 7.2"
        variables:
          PHP_VERSION: "7.2.10"
      - id: "7.1"
        display_name: "PHP 7.1"
        variables:
          PHP_VERSION: "7.1.22"
      - id: "7.0"
        display_name: "PHP 7.0"
        variables:
          PHP_VERSION: "7.0.32"
      - id: "5.6"
        display_name: "PHP 5.6"
        variables:
          PHP_VERSION: "5.6.38"

  - id: os-php5
    display_name: OS
    values:
      - id: ubuntu1604-test
        display_name: "Ubuntu 16.04"
        run_on: ubuntu1604-test
      - id: rhel70-test
        display_name: "RHEL 7.0"
        run_on: rhel70
      - id: rhel71-power8
        display_name: "RHEL 7.1 Power 8"
        run_on: rhel71-power8-test
  - id: os-php7
    display_name: OS
    values:
      - id: debian92-test
        display_name: "Debian 9.2"
        run_on: debian92-test
      - id: rhel70-test
        display_name: "RHEL 7.0"
        run_on: rhel70
      - id: rhel71-power8
        display_name: "RHEL 7.1 Power 8"
        run_on: rhel71-power8-test
      - id: rhel74-zseries
        display_name: "RHEL 7.4 zSeries"
        run_on: rhel72-zseries-test
      - id: ubuntu1804-arm64-test
        display_name: "Ubuntu 18.04 ARM64"
        run_on: ubuntu1804-arm64-test
      # Pending installation of PHP toolchain on macOS hosts (see: PHPC-869)
      # - id: macos-1014
      #   display_name: "Mac OS 10.14"
      #   run_on: macos-1014

  - id: storage-engine
    display_name: Storage
    values:
      - id: mmapv1
        display_name: MMAPv1
        variables:
           STORAGE_ENGINE: "mmapv1"
      - id: wiredtiger
        display_name: WiredTiger
        variables:
           STORAGE_ENGINE: "wiredtiger"
      - id: inmemory
        display_name: InMemory
        variables:
           STORAGE_ENGINE: "inmemory"

  - id: libmongoc-version
    display_name: libmongoc version
    values:
      - id: "1.16-latest"
        display_name: "1.16 latest"
        variables:
          LIBMONGOC_VERSION: "r1.16"
      - id: "master"
        display_name: "Upcoming release (master)"
        variables:
          LIBMONGOC_VERSION: "master"


buildvariants:

- matrix_name: "tests-php5"
  matrix_spec: {"os-php5": "*", "versions": "4.2", "php-versions": ["5.6"] }
  display_name: "All: ${versions}/${php-versions} — ${os-php5}"
  tasks:
     - name: "test-standalone-ssl"
     - name: "test-replicaset-auth"

- matrix_name: "tests-php7"
  matrix_spec: {"os-php7": "*", "versions": "4.2", "php-versions": ["7.0","7.1","7.2","7.3"] }
  exclude_spec:
    - {"os-php7": "ubuntu1804-arm64-test", "versions": "4.2", "php-versions": ["7.0","7.1","7.2"]}
  display_name: "All: ${versions}/${php-versions} — ${os-php7}"
  tasks:
     - name: "test-standalone-ssl"
     - name: "test-replicaset-auth"


- matrix_name: "mongo-30-php5"
  matrix_spec: {"os-php5": "*", "versions": ["3.0", "3.2", "3.4"], "php-versions": "5.6" }
  exclude_spec: {"os-php5": "rhel71-power8", "versions": "3.0", "php-versions": "5.6"}
  display_name: "${versions}/${php-versions} — ${os-php5}"
  tasks:
     - name: "test-standalone-old"
     - name: "test-replicaset-old"

- matrix_name: "mongo-30-php7"
  matrix_spec: {"os-php7": "*", "versions": ["3.0", "3.2", "3.4"], "php-versions": "7.3" }
  exclude_spec:
    - {"os-php7": "ubuntu1804-arm64-test", "versions": ["3.0", "3.2", "3.4"], "php-versions": "7.3"}
    - {"os-php7": "rhel71-power8", "versions": "3.0", "php-versions": "7.3"}
    - {"os-php7": "rhel74-zseries", "versions": ["3.0", "3.2"], "php-versions": "7.3"}
  display_name: "${versions}/${php-versions} — ${os-php7}"
  tasks:
     - name: "test-standalone-old"
     - name: "test-replicaset-old"


- matrix_name: "mongo-36-php5"
  matrix_spec: {"os-php5": "*", "versions": ["3.6"], "php-versions": "5.6" }
  display_name: "${versions}/${php-versions} — ${os-php5}"
  tasks:
     - name: "test-standalone"
     - name: "test-replicaset"
     - name: "test-replicaset-auth"

- matrix_name: "mongo-36-php7"
  matrix_spec: {"os-php7": "*", "versions": ["3.6"], "php-versions": "7.3" }
  exclude_spec:
    - {"os-php7": "ubuntu1804-arm64-test", "versions": "3.6", "php-versions": "7.3"}
  display_name: "${versions}/${php-versions} — ${os-php7}"
  tasks:
     - name: "test-standalone"
     - name: "test-replicaset"
     - name: "test-replicaset-auth"


- matrix_name: "mongo-40-php5"
  matrix_spec: {"os-php5": "*", "versions": ["4.0", "4.2", "latest"], "php-versions": "5.6" }
  display_name: "${versions}/${php-versions} — ${os-php5}"
  tasks:
     - name: "test-standalone"
     - name: "test-standalone-auth"
     - name: "test-standalone-ssl"
     - name: "test-replicaset"
     - name: "test-replicaset-auth"
     - name: "test-replicaset-single"
     - name: "test-sharded"
     - name: "test-sharded-rs"

- matrix_name: "mongo-40-php7"
  matrix_spec: {"os-php7": "*", "versions": ["4.0", "4.2", "latest"], "php-versions": "7.3" }
  exclude_spec:
    - {"os-php7": "rhel74-zseries", "versions": ["4.0", "4.2", "latest"], "php-versions": "7.3"}
    - {"os-php7": "ubuntu1804-arm64-test", "versions": "4.0", "php-versions": "7.3"}
  display_name: "${versions}/${php-versions} — ${os-php7}"
  tasks:
     - name: "test-standalone"
     - name: "test-standalone-auth"
     - name: "test-standalone-ssl"
     - name: "test-replicaset"
     - name: "test-replicaset-auth"
     - name: "test-replicaset-single"
     - name: "test-sharded"
     - name: "test-sharded-rs"

- matrix_name: "mongo-40-php7-nossl"
  matrix_spec: {"os-php7": "rhel74-zseries", "versions": ["4.2", "latest"], "php-versions": "7.3"}
  display_name: "${versions}/${php-versions} — ${os-php7}"
  tasks:
     - name: "test-standalone"
     - name: "test-standalone-auth"
     - name: "test-replicaset"
     - name: "test-replicaset-auth"
     - name: "test-replicaset-single"
     - name: "test-sharded"
     - name: "test-sharded-rs"

- matrix_name: "mongo-42-storage-engines"
  matrix_spec: {"os-php7": "debian92-test", "versions": "4.2", "php-versions": "7.3", "storage-engine": ["wiredtiger", "inmemory"]}
  display_name: "${versions}/${php-versions}/${os-php7} — ${storage-engine}"
  tasks:
     - name: "test-standalone"

- matrix_name: "mongo-40-storage-engines"
  matrix_spec: {"os-php7": "debian92-test", "versions": "4.0", "php-versions": "7.3", "storage-engine": "mmapv1"}
  display_name: "${versions}/${php-versions}/${os-php7} — ${storage-engine}"
  tasks:
     - name: "test-standalone"

- matrix_name: "libmongoc-versions-php7"
  matrix_spec: {"os-php7": "debian92-test", "versions": "4.2", "php-versions": "7.2", "libmongoc-version": "*"}
  display_name: "${versions}/${php-versions}/${os-php7} — libmongoc ${libmongoc-version}"
  tasks:
     - name: "test-standalone"
     - name: "test-replicaset"
     - name: "test-sharded-rs"
