Skip to content

PHPC-2689: Throw LogicException in Binary::getVectorType() and toArray() #2377

PHPC-2689: Throw LogicException in Binary::getVectorType() and toArray()

PHPC-2689: Throw LogicException in Binary::getVectorType() and toArray() #2377

Workflow file for this run

name: "Tests"
on:
pull_request:
branches:
- "v*.*"
- "feature/*"
push:
branches:
- "v*.*"
- "feature/*"
jobs:
linux-test:
name: "Linux Tests"
runs-on: "${{ matrix.os }}"
continue-on-error: ${{ matrix.allow_failures || false }}
strategy:
fail-fast: true
matrix:
os:
- "ubuntu-22.04"
php-version:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
- "8.5"
mongodb-version:
- "6.0"
topology:
- "server"
include:
- os: "ubuntu-24.04"
php-version: "8.1"
mongodb-version: "8.0"
topology: "replica_set"
- os: "ubuntu-24.04"
php-version: "8.1"
mongodb-version: "8.0"
topology: "sharded_cluster"
- os: "ubuntu-22.04"
php-version: "8.1"
mongodb-version: "6.0"
topology: "replica_set"
- os: "ubuntu-22.04"
php-version: "8.1"
mongodb-version: "6.0"
topology: "sharded_cluster"
- os: "ubuntu-24.04"
php-version: "8.6"
mongodb-version: "8.0"
topology: "replica_set"
allow_failures: true
steps:
- name: "Checkout"
uses: "actions/checkout@v6"
with:
submodules: true
- uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Setup MongoDB
id: setup-mongodb
uses: ./tests/drivers-evergreen-tools
with:
version: ${{ matrix.mongodb-version }}
topology: ${{ matrix.topology }}
- name: "Build Driver"
id: build-driver
uses: ./.github/actions/linux/build
with:
version: ${{ matrix.php-version }}
- name: "Run Tests"
run: make test
env:
TEST_PHP_ARGS: "-q -x --show-diff -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP"
TEST_PHP_JUNIT: "test-results.xml"
MONGODB_URI: ${{ steps.setup-mongodb.outputs.cluster-uri }}
- name: Upload test results to Codecov
uses: codecov/test-results-action@v1
with:
disable_search: true
files: test-results.xml
flags: "${{ matrix.mongodb-version }}-${{ matrix.topology }}"
token: ${{ secrets.CODECOV_TOKEN }}
pecl-test:
name: "Test PECL package"
runs-on: "ubuntu-latest"
env:
PHP_VERSION: "8.3"
steps:
- name: "Checkout"
uses: "actions/checkout@v6"
with:
submodules: true
- name: "Build Driver"
id: build-driver
uses: ./.github/actions/linux/build
with:
version: ${{ env.PHP_VERSION }}
- name: "Write changelog file for packaging"
run: echo "Testing" > changelog
- name: "Build package.xml"
run: "make package.xml RELEASE_NOTES_FILE=$(pwd)/changelog"
- name: "Build PECL package"
run: "make package"
# PECL always uses the version for the package name.
# Read it from the version file and store in env to use when uploading artifacts
- name: "Read current package version"
run: |
PACKAGE_VERSION=$(./bin/update-release-version.php get-version)
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> "$GITHUB_ENV"
echo "PACKAGE_FILE=mongodb-${PACKAGE_VERSION}.tgz" >> "$GITHUB_ENV"
- name: "Install release archive to verify correctness"
run: sudo pecl install ${{ env.PACKAGE_FILE }}
windows-test:
name: "Windows Tests"
runs-on: "${{ matrix.os }}"
defaults:
run:
shell: cmd
strategy:
fail-fast: false
matrix:
os: [ "windows-2022" ]
# Note: keep this in sync with the Windows matrix in build-windows-package.yml
php-version:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
- "8.5"
ts: [ ts, nts ]
steps:
- uses: actions/checkout@v6
with:
submodules: true
- id: setup-mongodb
uses: mongodb-labs/drivers-evergreen-tools@master
with:
version: "7.0"
topology: "server"
- name: "Build and Test"
id: build-driver
uses: ./.github/actions/windows/build
with:
php-version: ${{ matrix.php-version }}
ts: ${{ matrix.ts }}
run-tests: true
env:
NO_INTERACTION: 1
REPORT_EXIT_STATUS: 1
MONGODB_URI: ${{ steps.setup-mongodb.outputs.cluster-uri }}
CRYPT_SHARED_LIB_PATH: ${{ steps.setup-mongodb.outputs.crypt-shared-lib-path }}
test-system-libs:
name: "System Library Tests"
runs-on: "ubuntu-latest"
env:
PHP_VERSION: "8.3"
# Note: omit the patch version when referring to the libmongocrypt package
LIBMONGOCRYPT_VERSION: "1.17"
# Note: include the patch version when referring to a libmongoc release tarball
LIBMONGOC_VERSION: "2.2.2"
SERVER_VERSION: "8.0"
steps:
- name: "Checkout"
uses: "actions/checkout@v6"
with:
submodules: true
- name: "Install libmongocrypt"
uses: ./.github/actions/linux/build-libmongocrypt
with:
version: ${{ env.LIBMONGOCRYPT_VERSION }}
- name: "Build libmongoc"
uses: ./.github/actions/linux/build-libmongoc
with:
version: ${{ env.LIBMONGOC_VERSION }}
- name: "Build Driver"
uses: ./.github/actions/linux/build
with:
version: ${{ env.PHP_VERSION }}
configureOpts: "--with-mongodb-system-libs=yes"
- name: "Check driver version"
shell: bash
run: make show-config
- uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Setup MongoDB
id: setup-mongodb
uses: ./tests/drivers-evergreen-tools
with:
version: ${{ ENV.SERVER_VERSION }}
topology: "server"
- name: "Run Tests"
run: make test
env:
TEST_PHP_ARGS: "-q -x --show-diff -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP"
TEST_PHP_JUNIT: "test-results.xml"
MONGODB_URI: ${{ steps.setup-mongodb.outputs.cluster-uri }}
- name: Upload test results to Codecov
uses: codecov/test-results-action@v1
with:
disable_search: true
files: test-results.xml
flags: "${{ ENV.SERVER_VERSION }}-server"
token: ${{ secrets.CODECOV_TOKEN }}