Skip to content

Commit

Permalink
feat: Add support for PHP 8.1, 8.2 (#489)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This release requires a PHP version of >= 8.1.0.
  • Loading branch information
dplewis authored Apr 26, 2023
1 parent 7699895 commit d5783e3
Show file tree
Hide file tree
Showing 27 changed files with 18,133 additions and 3,001 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
name: ci
on:
push:
branches:
- master
pull_request:
branches:
- "**"
env:
NODE_VERSION: 16.17.1
jobs:
check-lock-file-version:
name: NPM Lock File Version
timeout-minutes: 5
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Check NPM lock file version
uses: mansona/npm-lockfile-version@v1
with:
version: 2
build:
runs-on: ubuntu-20.04
timeout-minutes: 30
strategy:
matrix:
include:
- name: PHP 8.1
PHP_VERSION: 8.1
- name: PHP 8.2
PHP_VERSION: 8.2
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.PHP_VERSION }}
- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ env.NODE_VERSION }}-
- run: composer install
- run: npm ci
- run: npm start
- run: npm run lint
- run: npm run test:coverage
- run: npm run document-check
- run: npm run document
env:
CI: true
- run: bash <(curl -s https://codecov.io/bash)
39 changes: 39 additions & 0 deletions .github/workflows/release-manual-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: release-manual-docs
on:
workflow_dispatch:
inputs:
tag:
default: ''
description: 'Version tag:'
jobs:
docs-publish:
if: github.event.inputs.tag != ''
runs-on: ubuntu-20.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tag }}
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Generate Docs
run: |
npm ci
npm run document-check
npm run documentation
env:
SOURCE_TAG: ${{ github.event.inputs.tag }}
- name: Deploy
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./.phpdoc/build
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.idea
composer.lock
.DS_Store
vendor

# npm based parse-server-test
Expand All @@ -10,12 +10,13 @@ test_logs
# ignore test results
phpunit-test-results
.phpunit.result.cache

.phpunit.cache
*.log

coverage.xml

# ignore phpdoc
output/
.phpdoc/

composer.phar
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* You only need this file if you are not using composer.
*/

if (version_compare(PHP_VERSION, '5.4.0', '<')) {
throw new Exception('The Parse SDK requires PHP version 5.4 or higher.');
if (version_compare(PHP_VERSION, '8.1.0', '<')) {
throw new Exception('The Parse SDK requires PHP version 8.1 or higher.');
}

/*
Expand Down
17 changes: 12 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,18 @@
}
],
"require": {
"php": ">= 7.1",
"php": ">=8.1 <8.3",
"ext-curl": "*",
"ext-json": "*"
},
"require-dev": {
"phpunit/phpunit": "7",
"squizlabs/php_codesniffer": "3.6.0",
"phpdocumentor/phpdocumentor": "2.9",
"jms/serializer": "1.7.1"
"phpunit/phpunit": "10.1.1",
"squizlabs/php_codesniffer": "3.7.2",
"phpdocumentor/phpdocumentor": "3.0.0",
"jms/serializer": "1.7.1",
"nikic/php-parser": "4.15"
},
"minimum-stability": "dev",
"autoload": {
"psr-4": {
"Parse\\": "src/Parse/"
Expand All @@ -31,5 +33,10 @@
"psr-4": {
"Parse\\Test\\": "tests/Parse/"
}
},
"config": {
"allow-plugins": {
"symfony/flex": true
}
}
}
Loading

0 comments on commit d5783e3

Please sign in to comment.