Skip to content

Adds PHP 8 support and Laminas CI workflow #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .ci/mongodb.ini

This file was deleted.

3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
/.gitattributes export-ignore
/.github/ export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/.laminas-ci/ export-ignore
/.laminas-ci.json export-ignore
/docs/ export-ignore
/mkdocs.yml export-ignore
/phpcs.xml export-ignore
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Continuous Integration"

on:
pull_request:
push:
branches:
- '[0-9]+.[0-9]+.x'
- 'refs/pull/*'
tags:

jobs:
matrix:
name: Generate job matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- name: Gather CI configuration
id: matrix
uses: laminas/laminas-ci-matrix-action@v1

qa:
name: QA Checks
needs: [matrix]
runs-on: ${{ matrix.operatingSystem }}
services:
mongo:
image: mongo
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea what health check to use for MongoDB.

strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }}
steps:
- name: ${{ matrix.name }}
uses: laminas/laminas-continuous-integration-action@v1
with:
job: ${{ matrix.job }}
env:
TESTS_LAMINAS_CACHE_EXTMONGODB_CONNECTSTRING: mongodb://mongo/
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/.phpunit.result.cache
/composer.lock
/docs/html/
/laminas-mkdoc-theme.tgz
/laminas-mkdoc-theme/
Expand Down
3 changes: 3 additions & 0 deletions .laminas-ci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extensions": ["mongodb"]
}
29 changes: 29 additions & 0 deletions .laminas-ci/composer-root-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash -l

if [[ -z "${GITHUB_BASE_REF}" ]]; then
echo "Environment variable \"GITHUB_BASE_REF\" does not exist."

exit 0
fi

BRANCH_REGEX="[0-9]+\.[0-9]+\.x"

if ! [[ "${GITHUB_BASE_REF}" =~ ${BRANCH_REGEX} ]]; then
echo "Environment variable \"GITHUB_BASE_REF\" does not match expectations."
echo "Must match ${BRANCH_REGEX}";

exit 0
fi

COMPOSER_ROOT_VERSION=$(echo ${GITHUB_BASE_REF} | sed 's/\.x/\.99/g')

echo "Determined composer root version as \"${COMPOSER_ROOT_VERSION}\"."

if [[ true = "${GITHUB_ACTIONS}" ]]; then
echo "Setting COMPOSER_ROOT_VERSION environment variable to \"${COMPOSER_ROOT_VERSION}\"."
if [ ! -w "${GITHUB_ENV}" ]; then
echo "Missing GITHUB_ENV environment variable. Cannot store COMPOSER_ROOT_VERSION to be available within the current check."
exit 1
fi
echo "COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION}" >> "${GITHUB_ENV}"
fi
7 changes: 7 additions & 0 deletions .laminas-ci/pre-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

WORKING_DIRECTORY=$2
JOB=$3
PHP_VERSION=$(echo "${JOB}" | jq -r '.php')

${WORKING_DIRECTORY}/.laminas-ci/composer-root-version.sh || exit 1
87 changes: 0 additions & 87 deletions .travis.yml

This file was deleted.

46 changes: 0 additions & 46 deletions CHANGELOG.md

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# laminas-cache-storage-adapter-ext-mongodb

[![Build Status](https://travis-ci.com/laminas/laminas-cache-storage-adapter-ext-mongodb.svg?branch=master)](https://travis-ci.com/laminas/laminas-cache-storage-adapter-ext-mongodb)
[![Coverage Status](https://coveralls.io/repos/github/laminas/laminas-cache-storage-adapter-ext-mongodb/badge.svg?branch=master)](https://coveralls.io/github/laminas/laminas-cache-storage-adapter-ext-mongodb?branch=master)
[![Build Status](https://github.com/laminas/laminas-cache-storage-adapter-ext-mongodb/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/laminas/laminas-cache-storage-adapter-ext-mongodb/actions/workflows/continuous-integration.yml)

This library provides …

Expand Down
13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,25 @@
],
"license": "BSD-3-Clause",
"require": {
"php": "^5.6 || ^7.0"
"php": "^7.3 || ~8.0.0"
},
"conflict": {
"laminas/laminas-cache": "<2.10"
"laminas/laminas-cache": "<2.10",
"mongodb/mongodb": "<1.8"
},
"provide": {
"laminas/laminas-cache-storage-implementation": "1.0"
},
"require-dev": {
"laminas/laminas-cache": "^2.10",
"laminas/laminas-cache-storage-adapter-test": "^1.0@dev",
"mongodb/mongodb": "^1.8.0",
Copy link
Contributor Author

@Slamdunk Slamdunk May 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was surprised this requirement wasn't there before: without it no test passes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was required by the travis configuration as there were different versions used for different php versions.

"laminas/laminas-cache": "^2.10.3",
"laminas/laminas-cache-storage-adapter-test": "^1.1.1",
"laminas/laminas-coding-standard": "~1.0.0",
"laminas/laminas-serializer": "^2.10.1",
"squizlabs/php_codesniffer": "^2.7"
},
"suggest": {
"ext-mongodb": "MongoDB, to use the ExtMongoDb storage adapter"
"mongodb/mongodb": "MongoDB, to use the ExtMongoDb storage adapter"
},
"config": {
"sort-packages": true
Expand Down
Loading