Skip to content
Merged
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
11 changes: 9 additions & 2 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ jobs:
with:
php-version: ${{ matrix.php-versions }}
tools: composer, pecl, phpunit
extensions: intl, json, mbstring, mysqlnd, xdebug, xml, sqlite3
extensions: intl, json, mbstring, gd, mysqlnd, xdebug, xml, sqlite3
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
id: composer-cache
Expand All @@ -65,7 +67,12 @@ jobs:
key: ${{ runner.os }}-phpstan-${{ github.sha }}
restore-keys: ${{ runner.os }}-phpstan-

- name: Install dependencies
- name: Install dependencies (limited)
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader

- name: Install dependencies (authenticated)
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/compare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# When a PR is opened or a push is made, compare
# code for backwards compatibility.
name: RoaveBC

on:
pull_request:
branches:
- develop
paths:
- 'src/**'

jobs:
compare:
name: Compare for Backwards Compatibility
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Run comparison (limited)
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
uses: docker://nyholm/roave-bc-check-ga

- name: Run comparison (authenticated)
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
uses: docker://nyholm/roave-bc-check-ga
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
34 changes: 26 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ jobs:
with:
php-version: ${{ matrix.php-versions }}
tools: composer, pecl, phpunit
extensions: intl, json, mbstring, mysqlnd, xdebug, xml, sqlite3
extensions: intl, json, mbstring, gd, mysqlnd, xdebug, xml, sqlite3
coverage: xdebug
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
id: composer-cache
Expand All @@ -43,29 +45,45 @@ jobs:
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
- name: Install dependencies (limited)
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader

- name: Install dependencies (authenticated)
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}

- name: Enable Tachycardia
run: echo "TACHYCARDIA_MONITOR_GA=enabled" >> $GITHUB_ENV

- name: Test with PHPUnit
run: vendor/bin/phpunit --verbose --coverage-text
env:
TERM: xterm-256color

- if: matrix.php-versions == '7.4'
name: Run Coveralls
- if: matrix.php-versions == '8.0'
name: Mutate with Infection
run: |
composer global require php-coveralls/php-coveralls:^2.4
php-coveralls --coverage_clover=build/logs/clover.xml -v
composer global require infection/infection
git fetch --depth=1 origin $GITHUB_BASE_REF
infection --threads=2 --skip-initial-tests --coverage=build/phpunit --git-diff-base=origin/$GITHUB_BASE_REF --git-diff-filter=AM --logger-github --ignore-msi-with-no-mutations

- if: matrix.php-versions == '8.0'
name: Run Coveralls
run: vendor/bin/php-coveralls --verbose --coverage_clover=build/phpunit/clover.xml --json_path build/phpunit/coveralls-upload.json
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: PHP ${{ matrix.php-versions }} - ${{ matrix.db-platforms }}
COVERALLS_FLAG_NAME: PHP ${{ matrix.php-versions }}

coveralls:
needs: [main]
name: Coveralls Finished
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
- name: Upload Coveralls results
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
33 changes: 33 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

use Nexus\CsConfig\Factory;
use PhpCsFixer\Finder;
use Tatter\Tools\Standard;

$finder = Finder::create()
->files()
->in(__DIR__)
->exclude('build')
->append([__FILE__]);

// Remove overrides for incremental changes
$overrides = [
'array_indentation' => false,
'braces' => false,
'indentation_type' => false,
];

$options = [
'finder' => $finder,
'cacheFile' => 'build/.php-cs-fixer.cache',
];

/* Reenable after incremental changes are applied
return Factory::create(new Standard(), $overrides, $options)->forLibrary(
'Library',
'Tatter Software',
'',
2021
);
*/
return Factory::create(new Standard(), $overrides, $options)->forProjects();
109 changes: 55 additions & 54 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,56 +1,57 @@
{
"name": "tatter/assets",
"type": "library",
"description": "Asset publishing and loading for CodeIgniter 4",
"keywords": [
"codeigniter",
"codeigniter4",
"assets",
"loader",
"css",
"javascript"
],
"homepage": "https://github.com/tattersoftware/codeigniter4-assets",
"license": "MIT",
"authors": [
{
"name": "Matthew Gatner",
"email": "mgatner@tattersoftware.com",
"homepage": "https://tattersoftware.com",
"role": "Developer"
}
],
"require": {
"php": "^7.3||^8.0"
},
"require-dev": {
"codeigniter4/codeigniter4": "dev-develop",
"tatter/tools": "^1.4"
},
"autoload": {
"psr-4": {
"Tatter\\Assets\\": "src"
},
"exclude-from-classmap": [
"**/Database/Migrations/**"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\Support\\": "tests/_support"
}
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/codeigniter4/CodeIgniter4"
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"analyze": "phpstan analyze",
"style": "phpcbf --standard=./vendor/codeigniter4/codeigniter4-standard/CodeIgniter4 tests/ src/",
"test": "phpunit"
}
"name": "tatter/assets",
"type": "library",
"description": "Asset publishing and loading for CodeIgniter 4",
"keywords": [
"codeigniter",
"codeigniter4",
"assets",
"loader",
"css",
"javascript"
],
"homepage": "https://github.com/tattersoftware/codeigniter4-assets",
"license": "MIT",
"authors": [
{
"name": "Matthew Gatner",
"email": "mgatner@tattersoftware.com",
"homepage": "https://tattersoftware.com",
"role": "Developer"
}
],
"require": {
"php": "^7.3 || ^8.0"
},
"require-dev": {
"codeigniter4/codeigniter4": "dev-develop",
"tatter/tools": "^1.10"
},
"autoload": {
"psr-4": {
"Tatter\\Assets\\": "src"
},
"exclude-from-classmap": [
"**/Database/Migrations/**"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\Support\\": "tests/_support"
}
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/codeigniter4/CodeIgniter4"
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"analyze": "phpstan analyze",
"mutate": "infection --threads=2 --skip-initial-tests --coverage=build/phpunit",
"style": "php-cs-fixer fix --verbose --ansi",
"test": "phpunit"
}
}
19 changes: 19 additions & 0 deletions infection.json.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"source": {
"directories": [
"src"
],
"excludes": [
"Config",
"Database/Migrations",
"Views"
]
},
"logs": {
"text": "build/infection.log"
},
"mutators": {
"@default": true
},
"bootstrap": "vendor/codeigniter4/codeigniter4/system/Test/bootstrap.php"
}
7 changes: 5 additions & 2 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ parameters:
- src/Config/Routes.php
- src/Views/*
ignoreErrors:
- '#Call to an undefined static method Config\\Services::manifests\(\)#'
- '#Unsafe usage of new static\(\)*#'
- '#Call to an undefined static method Config\\Services::[A-Za-z]+\(\)#'
universalObjectCratesClasses:
- CodeIgniter\Entity
- CodeIgniter\Entity\Entity
- Faker\Generator
scanDirectories:
- vendor/codeigniter4/codeigniter4/system/Helpers
dynamicConstantNames:
Expand Down
Loading