Skip to content
Open
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
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/.github export-ignore
/tests export-ignore
/fixtures export-ignore

*.php diff=php
62 changes: 55 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches: ["master"]
pull_request:
branches: ["master"]
schedule:
- cron: "0 6 * * 3"
workflow_dispatch:

permissions:
Expand All @@ -13,18 +15,64 @@ permissions:
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: ["latest", "8.1", "7.4"]
php: ["8.2", "8.3", "8.4"]

runs-on: ${{ matrix.os }}
name: Test on ${{ matrix.os }}, PHP ${{ matrix.php }}

steps:
- uses: actions/checkout@v4
- uses: php-actions/composer@v6
- name: Checkout
uses: actions/checkout@v4

- name: PHPUnit tests
uses: php-actions/phpunit@v4
with:
php_version: ${{ matrix.php }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: pcov

- name: Get Composer Cache Directory 2
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v4
id: actions-cache
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php }}-

- name: Cache PHP dependencies
uses: actions/cache@v4
id: vendor-cache
with:
path: vendor
key: ${{ runner.os }}-build-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}

- name: Composer Install
run: composer install --no-progress

- name: Code style checks
run: ./vendor/bin/phpcs

- name: PHPStan code analysis
run: php vendor/bin/phpstan analyze

- name: PHPinsights code analysis
run: php vendor/bin/phpinsights analyse --no-interaction

- name: Execute Rector
run: vendor/bin/rector --dry-run

- name: Unit tests
run: ./vendor/bin/phpunit --coverage-clover=coverage.xml

- name: Send code coverage report to Codecov.io
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/vendor/
/composer.lock
/.phpunit.result.cache
38 changes: 29 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
{
"name": "bluemoehre/flac-php",
"description": "PHP class for native reading FLAC's metadata and Vorbis comment",
"license": "GPL-2.0-only",
"autoload": {
"classmap": ["src/Flac.php"]
},
"require-dev": {
"phpunit/phpunit": "9.*"
}
"name": "bluemoehre/flac-php",
"description": "PHP class for native reading FLAC's metadata and Vorbis comment",
"license": "GPL-2.0-only",
"autoload": {
"psr-4": { "bluemoehre\\": "src/" }
},
"autoload-dev": {
"psr-4": { "bluemoehre\\Test\\": "tests/" }
},
"require": {
"php" : ">=8.2"
},
"config": {
"optimize-autoloader": true,
"sort-packages": true
},
"require-dev": {
"phpunit/phpunit": "^11",
"squizlabs/php_codesniffer" : ">=3.8",
"phpstan/phpstan": "^2",
"phpstan/phpstan-phpunit": "^2",
"rector/rector": "^2",
"nunomaduro/phpinsights": "^2"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
Loading