Skip to content

Commit

Permalink
Merge pull request #5 from npghub/master
Browse files Browse the repository at this point in the history
Catch up with upstream changes
  • Loading branch information
raxbg authored Jun 3, 2024
2 parents cc791ad + eda7c24 commit 1121fdc
Show file tree
Hide file tree
Showing 41 changed files with 779 additions and 197 deletions.
47 changes: 18 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

on:
pull_request:
push:
branches:
- main
pull_request:
schedule:
- cron: '3 3 * * 1'

Expand All @@ -14,11 +16,11 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
php-version: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
php-version: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -39,29 +41,25 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: [ '5.6', '7.0', '7.1', '7.2', '7.3' ]
coverage: [ 'none' ]
include:
- php-version: '7.4'
coverage: xdebug
php-version: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
ini-values: error_reporting=E_ALL
tools: composer:v2
coverage: "${{ matrix.coverage }}"
coverage: none

- name: Show the Composer configuration
run: composer config --global --list

- name: Cache dependencies installed with composer
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/composer
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
Expand All @@ -74,14 +72,7 @@ jobs:
composer show;
- name: Run Tests
run: ./vendor/bin/phpunit --coverage-clover build/coverage/xml

- name: Upload coverage results to Codacy
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
if: "${{ matrix.coverage != 'none' && env.CODACY_PROJECT_TOKEN != '' }}"
run: |
./vendor/bin/codacycoverage clover build/coverage/xml
run: ./vendor/bin/phpunit

static-analysis:
name: Static Analysis
Expand All @@ -93,17 +84,15 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- command: sniffer
php-version: '7.4'
- command: fixer
php-version: '7.4'
- command: stan
php-version: '7.4'
command:
- fixer
- stan
php-version:
- '8.3'

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -116,7 +105,7 @@ jobs:
run: composer config --global --list

- name: Cache dependencies installed with composer
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/composer
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
Expand All @@ -130,7 +119,7 @@ jobs:
- name: Install development tools
run: |
phive --no-progress install --trust-gpg-keys BBAB5DF0A0D6672989CF1869E82B2FB314E9906E,A972B9ABB95D0B760B51442231C7E470E2138192,D32680D5957DC7116BE29C14CF1A108D0E7AE720
phive --no-progress install --trust-gpg-keys BBAB5DF0A0D6672989CF1869E82B2FB314E9906E
- name: Run Command
run: composer ci:php:${{ matrix.command }}
57 changes: 57 additions & 0 deletions .github/workflows/codecoverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

on:
push:
branches:
- main
pull_request:

name: Code coverage

jobs:
code-coverage:
name: Code coverage

runs-on: ubuntu-22.04

strategy:
matrix:
php-version: [ '7.4' ]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
ini-values: error_reporting=E_ALL
tools: composer:v2
coverage: xdebug

- name: Show the Composer configuration
run: composer config --global --list

- name: Cache dependencies installed with composer
uses: actions/cache@v4
with:
path: ~/.cache/composer
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php-version }}-composer-
- name: Install Composer dependencies
run: |
composer update --with-dependencies --no-progress;
composer show;
- name: Run Tests
run: ./vendor/bin/phpunit --coverage-clover build/coverage/xml

- name: Upload coverage results to Codacy
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
if: "${{ env.CODACY_PROJECT_TOKEN != '' }}"
run: |
./vendor/bin/codacycoverage clover build/coverage/xml
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/.phive/*
/.php-cs-fixer.cache
/.php_cs.cache
/.phpunit.result.cache
/composer.lock
/phpstan.neon
/vendor/
Expand Down
5 changes: 1 addition & 4 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="php-cs-fixer" version="^3.13.2" installed="3.13.2" location="./.phive/php-cs-fixer.phar" copy="false"/>
<phar name="phpcbf" version="^3.7.1" installed="3.7.1" location="./.phive/phpcbf.phar" copy="false"/>
<phar name="phpcs" version="^3.7.1" installed="3.7.1" location="./.phive/phpcs.phar" copy="false"/>
<phar name="phpstan" version="^1.9.14" installed="1.9.14" location="./.phive/phpstan.phar" copy="false"/>
<phar name="php-cs-fixer" version="^3.50.0" installed="3.50.0" location="./.phive/php-cs-fixer" copy="false"/>
</phive>
45 changes: 44 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,47 @@
# Revision History
# Changelog

All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/).

## x.y.z

### Added

- Add a class diagram to the README (#482)
- Add support for the `dvh`, `lvh` and `svh` length units (#415)
- Add more tests (#449)

### Changed

- Improve performance of Value::parseValue with many delimiters by refactoring to remove array_search()
- Add visibility to all class/interface constants (#469)

### Deprecated

### Removed

- Drop support for PHP < 7.2 (#420)

### Fixed

- Fix PHP notice caused by parsing invalid color values having less than 6 characters (#485)
- Fix (regression) failure to parse at-rules with strict parsing (#456)

## 8.5.0

### Added

- Add a method to get an import's media queries (#384)
- Add more unit tests (#381, #382)

### Fixed

- Retain CSSList and Rule comments when rendering CSS (#351)
- Replace invalid `turns` unit with `turn` (#350)
- Also allow string values for rules (#348)
- Fix invalid calc parsing (#169)
- Handle scientific notation when parsing sizes (#179)
- Fix PHP 8.1 compatibility in `ParserState::strsplit()` (#344)

## 8.4.0

Expand Down
Loading

0 comments on commit 1121fdc

Please sign in to comment.