Skip to content

Commit 7aaebb2

Browse files
committed
Merge branch 'main' into fix/expression-parsing
2 parents ca89a71 + 9dc957b commit 7aaebb2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1916
-1359
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/.github/ export-ignore
44
/.gitignore export-ignore
55
/.phive/ export-ignore
6+
/CODE_OF_CONDUCT.md export-ignore
67
/bin/ export-ignore
78
/config/ export-ignore
89
/phpunit.xml export-ignore

.github/CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Contributing to PHP-CSS-Parser
2+
3+
Those that wish to contribute bug fixes, new features, refactorings and
4+
clean-up to PHP-CSS-Parser are more than welcome.
5+
6+
When you contribute, please take the following things into account:
7+
8+
## Contributor Code of Conduct
9+
10+
Please note that this project is released with a
11+
[Contributor Code of Conduct](../CODE_OF_CONDUCT.md). By participating in this
12+
project, you agree to abide by its terms.

.github/dependabot.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
version: 2
44
updates:
5-
- package-ecosystem: "github-actions"
6-
directory: "/"
7-
schedule:
8-
interval: "daily"
5+
- package-ecosystem: "github-actions"
6+
directory: "/"
7+
schedule:
8+
interval: "daily"
99

10-
- package-ecosystem: "composer"
11-
directory: "/"
12-
schedule:
13-
interval: "daily"
14-
allow:
15-
- dependency-type: "development"
16-
versioning-strategy: "increase"
10+
- package-ecosystem: "composer"
11+
directory: "/"
12+
schedule:
13+
interval: "daily"
14+
allow:
15+
- dependency-type: "development"
16+
versioning-strategy: "increase"

.github/workflows/ci.yml

Lines changed: 138 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,145 @@
11
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
22

33
on:
4-
pull_request:
5-
push:
6-
schedule:
7-
- cron: '3 3 * * 1'
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
schedule:
9+
- cron: '3 3 * * 1'
810

911
name: CI
1012

1113
jobs:
12-
php-lint:
13-
name: PHP Lint
14-
runs-on: ubuntu-22.04
15-
strategy:
16-
matrix:
17-
php-version: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
18-
19-
steps:
20-
- name: Checkout
21-
uses: actions/checkout@v3
22-
23-
- name: Install PHP
24-
uses: shivammathur/setup-php@v2
25-
with:
26-
php-version: ${{ matrix.php-version }}
27-
coverage: none
28-
29-
- name: PHP Lint
30-
run: find src tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
31-
32-
unit-tests:
33-
name: Unit tests
34-
35-
runs-on: ubuntu-22.04
36-
37-
needs: [ php-lint ]
38-
39-
strategy:
40-
fail-fast: false
41-
matrix:
42-
php-version: [ '5.6', '7.0', '7.1', '7.2', '7.3' ]
43-
coverage: [ 'none' ]
44-
include:
45-
- php-version: '7.4'
46-
coverage: xdebug
47-
48-
steps:
49-
- name: Checkout
50-
uses: actions/checkout@v3
51-
52-
- name: Install PHP
53-
uses: shivammathur/setup-php@v2
54-
with:
55-
php-version: ${{ matrix.php-version }}
56-
ini-values: error_reporting=E_ALL
57-
tools: composer:v2
58-
coverage: "${{ matrix.coverage }}"
59-
60-
- name: Show the Composer configuration
61-
run: composer config --global --list
62-
63-
- name: Cache dependencies installed with composer
64-
uses: actions/cache@v3
65-
with:
66-
path: ~/.cache/composer
67-
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
68-
restore-keys: |
69-
php${{ matrix.php-version }}-composer-
70-
71-
- name: Install Composer dependencies
72-
run: |
73-
composer update --with-dependencies --no-progress;
74-
composer show;
75-
76-
- name: Run Tests
77-
run: ./vendor/bin/phpunit --coverage-clover build/coverage/xml
78-
79-
- name: Upload coverage results to Codacy
80-
env:
81-
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
82-
if: "${{ matrix.coverage != 'none' && env.CODACY_PROJECT_TOKEN != '' }}"
83-
run: |
84-
./vendor/bin/codacycoverage clover build/coverage/xml
85-
86-
static-analysis:
87-
name: Static Analysis
88-
89-
runs-on: ubuntu-22.04
90-
91-
needs: [ php-lint ]
92-
93-
strategy:
94-
fail-fast: false
95-
matrix:
96-
include:
97-
- command: sniffer
98-
php-version: '7.4'
99-
- command: fixer
100-
php-version: '7.4'
101-
- command: stan
102-
php-version: '7.4'
103-
104-
steps:
105-
- name: Checkout
106-
uses: actions/checkout@v3
107-
108-
- name: Install PHP
109-
uses: shivammathur/setup-php@v2
110-
with:
111-
php-version: ${{ matrix.php-version }}
112-
tools: "composer:v2, phive"
113-
coverage: none
114-
115-
- name: Show the Composer configuration
116-
run: composer config --global --list
117-
118-
- name: Cache dependencies installed with composer
119-
uses: actions/cache@v3
120-
with:
121-
path: ~/.cache/composer
122-
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
123-
restore-keys: |
124-
php${{ matrix.php-version }}-composer-
125-
126-
- name: Install Composer dependencies
127-
run: |
128-
composer update --with-dependencies --no-progress;
129-
composer show;
130-
131-
- name: Install development tools
132-
run: |
133-
phive --no-progress install --trust-gpg-keys BBAB5DF0A0D6672989CF1869E82B2FB314E9906E,A972B9ABB95D0B760B51442231C7E470E2138192,D32680D5957DC7116BE29C14CF1A108D0E7AE720
134-
135-
- name: Run Command
136-
run: composer ci:php:${{ matrix.command }}
14+
php-lint:
15+
name: PHP Lint
16+
runs-on: ubuntu-22.04
17+
strategy:
18+
matrix:
19+
php-version: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Install PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php-version }}
29+
ini-file: development
30+
tools: composer:v2
31+
coverage: none
32+
33+
- name: Show the Composer configuration
34+
run: composer config --global --list
35+
36+
- name: Cache dependencies installed with composer
37+
uses: actions/cache@v4
38+
with:
39+
path: ~/.cache/composer
40+
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
41+
restore-keys: |
42+
php${{ matrix.php-version }}-composer-
43+
44+
- name: Install Composer dependencies
45+
run: |
46+
composer update --with-dependencies --no-progress;
47+
composer show;
48+
49+
- name: PHP Lint
50+
run: composer ci:php:lint
51+
52+
unit-tests:
53+
name: Unit tests
54+
55+
runs-on: ubuntu-22.04
56+
57+
needs: [ php-lint ]
58+
59+
strategy:
60+
fail-fast: false
61+
matrix:
62+
php-version: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]
63+
64+
steps:
65+
- name: Checkout
66+
uses: actions/checkout@v4
67+
68+
- name: Install PHP
69+
uses: shivammathur/setup-php@v2
70+
with:
71+
php-version: ${{ matrix.php-version }}
72+
ini-file: development
73+
tools: composer:v2
74+
coverage: none
75+
76+
- name: Show the Composer configuration
77+
run: composer config --global --list
78+
79+
- name: Cache dependencies installed with composer
80+
uses: actions/cache@v4
81+
with:
82+
path: ~/.cache/composer
83+
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
84+
restore-keys: |
85+
php${{ matrix.php-version }}-composer-
86+
87+
- name: Install Composer dependencies
88+
run: |
89+
composer update --with-dependencies --no-progress;
90+
composer show;
91+
92+
- name: Run Tests
93+
run: ./vendor/bin/phpunit
94+
95+
static-analysis:
96+
name: Static Analysis
97+
98+
runs-on: ubuntu-22.04
99+
100+
needs: [ php-lint ]
101+
102+
strategy:
103+
fail-fast: false
104+
matrix:
105+
command:
106+
- fixer
107+
- stan
108+
- rector
109+
php-version:
110+
- '8.3'
111+
112+
steps:
113+
- name: Checkout
114+
uses: actions/checkout@v4
115+
116+
- name: Install PHP
117+
uses: shivammathur/setup-php@v2
118+
with:
119+
php-version: ${{ matrix.php-version }}
120+
ini-file: development
121+
tools: "composer:v2, phive"
122+
coverage: none
123+
124+
- name: Show the Composer configuration
125+
run: composer config --global --list
126+
127+
- name: Cache dependencies installed with composer
128+
uses: actions/cache@v4
129+
with:
130+
path: ~/.cache/composer
131+
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
132+
restore-keys: |
133+
php${{ matrix.php-version }}-composer-
134+
135+
- name: Install Composer dependencies
136+
run: |
137+
composer update --with-dependencies --no-progress;
138+
composer show;
139+
140+
- name: Install development tools
141+
run: |
142+
phive --no-progress install --trust-gpg-keys BBAB5DF0A0D6672989CF1869E82B2FB314E9906E
143+
144+
- name: Run Command
145+
run: composer ci:php:${{ matrix.command }}

.github/workflows/codecoverage.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
name: Code coverage
10+
11+
jobs:
12+
code-coverage:
13+
name: Code coverage
14+
15+
runs-on: ubuntu-22.04
16+
17+
strategy:
18+
matrix:
19+
php-version: [ '7.4' ]
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Install PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php-version }}
29+
ini-file: development
30+
tools: composer:v2
31+
coverage: xdebug
32+
33+
- name: Show the Composer configuration
34+
run: composer config --global --list
35+
36+
- name: Cache dependencies installed with composer
37+
uses: actions/cache@v4
38+
with:
39+
path: ~/.cache/composer
40+
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
41+
restore-keys: |
42+
php${{ matrix.php-version }}-composer-
43+
44+
- name: Install Composer dependencies
45+
run: |
46+
composer update --with-dependencies --no-progress;
47+
composer show;
48+
49+
- name: Run Tests
50+
run: ./vendor/bin/phpunit --coverage-clover build/coverage/xml
51+
52+
- name: Upload coverage results to Codacy
53+
env:
54+
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
55+
if: "${{ env.CODACY_PROJECT_TOKEN != '' }}"
56+
run: |
57+
./vendor/bin/codacycoverage clover build/coverage/xml

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/.phive/*
22
/.php-cs-fixer.cache
33
/.php_cs.cache
4+
/.phpunit.result.cache
45
/composer.lock
56
/phpstan.neon
67
/vendor/

.phive/phars.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="php-cs-fixer" version="^3.13.2" installed="3.13.2" location="./.phive/php-cs-fixer.phar" copy="false"/>
4-
<phar name="phpcbf" version="^3.7.1" installed="3.7.1" location="./.phive/phpcbf.phar" copy="false"/>
5-
<phar name="phpcs" version="^3.7.1" installed="3.7.1" location="./.phive/phpcs.phar" copy="false"/>
6-
<phar name="phpstan" version="^1.9.14" installed="1.9.14" location="./.phive/phpstan.phar" copy="false"/>
3+
<phar name="php-cs-fixer" version="^3.59.3" installed="3.59.3" location="./.phive/php-cs-fixer" copy="false"/>
74
</phive>

0 commit comments

Comments
 (0)