Skip to content

Commit

Permalink
Added support for PHP 8.2 and 8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiang committed Jan 24, 2024
1 parent 25b4689 commit 719fd34
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 5,154 deletions.
52 changes: 42 additions & 10 deletions .github/workflows/unit.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,58 @@
name: Unit Tests
name: Continuous Integration

on: [push, pull_request]

jobs:
unittest:
psalm:
name: Psalm
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Psalm
uses: docker://vimeo/psalm-github-actions
with:
security_analysis: true
report_file: results.sarif
composer_ignore_platform_reqs: true

- name: Upload Security Analysis results to GitHub
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif

# we may use whatever way to install phpcs, just specify the path on the next step
# however, curl seems to be the fastest
- name: Install PHP_CodeSniffer
run: |
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
php phpcs.phar --version
- uses: tinovyatkin/action-php-codesniffer@v1
with:
files: "**.php" # you may customize glob as needed
phpcs_path: php phpcs.phar
standard: phpcs.xml

unittest:
name: Unit Tests - PHP ${{ matrix.php.version }} ${{ matrix.prefer-lowest }}
runs-on: ubuntu-latest
strategy:
matrix:
php:
- version: 7.4
coverage: false
- version: 8.0
coverage: true
coverage: false
- version: 8.1
coverage: false
- version: 8.2
coverage: true
- version: 8.3
coverage: false
prefer-lowest: ['', '--prefer-lowest']

name: Unit Tests - PHP ${{ matrix.php.version }} ${{ matrix.prefer-lowest }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -33,7 +65,7 @@ jobs:

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
Expand All @@ -53,11 +85,11 @@ jobs:

- name: Run test suite
if: ${{ ! matrix.php.coverage }}
run: ./vendor/bin/phpunit --verbose
run: ./vendor/bin/phpunit

- name: Run test suite with code coverage
if: ${{ matrix.php.coverage }}
run: ./vendor/bin/phpunit --verbose --coverage-clover=build/logs/clover.xml
run: ./vendor/bin/phpunit --coverage-clover=build/logs/clover.xml
env:
XDEBUG_MODE: coverage

Expand Down
35 changes: 0 additions & 35 deletions .github/workflows/static.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
.phpunit.result.cache
.phpcs-cache
phpunit.xml
composer.lock
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ Date parsing library supporting the full format RFC3339. The following formats a
[![PHP Version Require](http://poser.pugx.org/fabiang/dateparser/require/php)](https://packagist.org/packages/fabiang/dateparser)
[![Latest Stable Version](http://poser.pugx.org/fabiang/dateparser/v)](https://packagist.org/packages/fabiang/dateparser)
[![License](http://poser.pugx.org/fabiang/dateparser/license)](https://packagist.org/packages/fabiang/dateparser)
[![Unit Tests](https://github.com/fabiang/dateparser/actions/workflows/unit.yml/badge.svg)](https://github.com/fabiang/dateparser/actions/workflows/unit.yml)
[![Static Code Analysis](https://github.com/fabiang/dateparser/actions/workflows/static.yml/badge.svg)](https://github.com/fabiang/dateparser/actions/workflows/static.yml)
[![Continuous Integration](https://github.com/fabiang/dateparser/actions/workflows/ci.yml/badge.svg)](https://github.com/fabiang/dateparser/actions/workflows/ci.yml)

## Installation

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"minimum-stability": "stable",
"require": {
"php": "^7.4 || ~8.0.0 || ~8.1.0",
"php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
"phplrt/runtime": "^3.2"
},
"autoload": {
Expand All @@ -21,7 +21,7 @@
}
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"phpunit/phpunit": "^9.5.16 || ^10.0",
"squizlabs/php_codesniffer": "^3.7",
"vimeo/psalm": "^4.23",
"laminas/laminas-coding-standard": "^2.3",
Expand Down
Loading

0 comments on commit 719fd34

Please sign in to comment.