Skip to content

Commit 26efdfe

Browse files
authored
Merge pull request #33 from tattersoftware/tools
Toolkit
2 parents d5bc515 + 46527d1 commit 26efdfe

File tree

7 files changed

+351
-83
lines changed

7 files changed

+351
-83
lines changed

.github/workflows/inspect.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# When a PR is opened or a push is made, perform an
2+
# architectural inspection on the code using Deptrac.
3+
name: Deptrac
4+
5+
on:
6+
pull_request:
7+
branches:
8+
- 'develop'
9+
paths:
10+
- 'src/**'
11+
- 'tests/**'
12+
- 'composer.**'
13+
- 'depfile.yaml'
14+
- '.github/workflows/inspect.yml'
15+
push:
16+
branches:
17+
- 'develop'
18+
paths:
19+
- 'src/**'
20+
- 'tests/**'
21+
- 'composer.**'
22+
- 'depfile.yaml'
23+
- '.github/workflows/inspect.yml'
24+
25+
jobs:
26+
build:
27+
name: PHP ${{ matrix.php-versions }} Architectural Inspection
28+
runs-on: ubuntu-latest
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
php-versions: ['7.4', '8.0']
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v2
36+
37+
- name: Setup PHP
38+
uses: shivammathur/setup-php@v2
39+
with:
40+
php-version: ${{ matrix.php-versions }}
41+
tools: composer, pecl, phive, phpunit
42+
extensions: intl, json, mbstring, gd, mysqlnd, xdebug, xml, sqlite3
43+
env:
44+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Get composer cache directory
47+
id: composer-cache
48+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
49+
50+
- name: Create composer cache directory
51+
run: mkdir -p ${{ steps.composer-cache.outputs.dir }}
52+
53+
- name: Cache composer dependencies
54+
uses: actions/cache@v2
55+
with:
56+
path: ${{ steps.composer-cache.outputs.dir }}
57+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
58+
restore-keys: ${{ runner.os }}-composer-
59+
60+
- name: Create Deptrac cache directory
61+
run: mkdir -p build/
62+
63+
- name: Cache Deptrac results
64+
uses: actions/cache@v2
65+
with:
66+
path: build
67+
key: ${{ runner.os }}-deptrac-${{ github.sha }}
68+
restore-keys: ${{ runner.os }}-deptrac-
69+
70+
- name: Install dependencies (limited)
71+
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
72+
run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
73+
74+
- name: Install dependencies (authenticated)
75+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
76+
run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
77+
env:
78+
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
79+
80+
- name: Run architectural inspection
81+
run: |
82+
sudo phive --no-progress install --global qossmic/deptrac --trust-gpg-keys B8F640134AB1782E
83+
deptrac analyze --cache-file=build/deptrac.cache

.github/workflows/test.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,11 @@ jobs:
5555
env:
5656
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
5757

58-
- name: Enable Tachycardia
59-
run: echo "TACHYCARDIA_MONITOR_GA=enabled" >> $GITHUB_ENV
60-
6158
- name: Test with PHPUnit
6259
run: vendor/bin/phpunit --verbose --coverage-text
6360
env:
6461
TERM: xterm-256color
62+
TACHYCARDIA_MONITOR_GA: enabled
6563

6664
- if: matrix.php-versions == '8.0'
6765
name: Mutate with Infection

.php-cs-fixer.dist.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
use Nexus\CsConfig\Factory;
4+
use PhpCsFixer\Finder;
5+
use Tatter\Tools\Standard;
6+
7+
$finder = Finder::create()
8+
->files()
9+
->in(__DIR__)
10+
->exclude('build')
11+
->append([__FILE__]);
12+
13+
// Remove overrides for incremental changes
14+
$overrides = [
15+
'array_indentation' => false,
16+
'braces' => false,
17+
'indentation_type' => false,
18+
];
19+
20+
$options = [
21+
'finder' => $finder,
22+
'cacheFile' => 'build/.php-cs-fixer.cache',
23+
];
24+
25+
/* Reenable after incremental changes are applied
26+
return Factory::create(new Standard(), $overrides, $options)->forLibrary(
27+
'Library',
28+
'Tatter Software',
29+
'',
30+
2021
31+
);
32+
*/
33+
return Factory::create(new Standard(), $overrides, $options)->forProjects();

composer.json

Lines changed: 79 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,81 @@
11
{
2-
"name": "tatter/files",
3-
"type": "library",
4-
"description": "File uploads and management, for CodeIgniter 4",
5-
"keywords": [
6-
"codeigniter",
7-
"codeigniter4",
8-
"files",
9-
"uploads",
10-
"dropzone"
11-
],
12-
"homepage": "https://github.com/tattersoftware/codeigniter4-files",
13-
"license": "MIT",
14-
"authors": [
15-
{
16-
"name": "Matthew Gatner",
17-
"email": "[email protected]",
18-
"homepage": "https://tattersoftware.com",
19-
"role": "Developer"
20-
}
21-
],
22-
"require": {
23-
"php": "^7.3 || ^8.0",
24-
"components/jquery": "^3.3",
25-
"enyo/dropzone": "^5.7",
26-
"fortawesome/font-awesome": "^5.8",
27-
"tatter/alerts": "^2.0",
28-
"tatter/assets": "^2.2",
29-
"tatter/audits": "^1.0",
30-
"tatter/exports": "^2.0",
31-
"tatter/permits": "^2.0",
32-
"tatter/settings": "^1.0 || ^2.0",
33-
"tatter/thumbnails": "^1.2",
34-
"twbs/bootstrap": "^4.5"
35-
},
36-
"require-dev": {
37-
"antecedent/patchwork": "^2.1",
38-
"codeigniter4/codeigniter4": "dev-develop",
39-
"codeigniter4/codeigniter4-standard": "^1.0",
40-
"myth/auth": "dev-develop",
41-
"tatter/tools": "^1.8"
42-
},
43-
"autoload": {
44-
"psr-4": {
45-
"Tatter\\Files\\": "src"
46-
},
47-
"exclude-from-classmap": [
48-
"**/Database/Migrations/**"
49-
]
50-
},
51-
"autoload-dev": {
52-
"psr-4": {
53-
"Tests\\Support\\": "tests/_support"
54-
}
55-
},
56-
"repositories": [
57-
{
58-
"type": "vcs",
59-
"url": "https://github.com/codeigniter4/CodeIgniter4",
60-
"no-api": true
61-
},
62-
{
63-
"type": "vcs",
64-
"url": "https://github.com/lonnieezell/myth-auth",
65-
"no-api": true
66-
},
67-
{
68-
"type": "composer",
69-
"url": "https://asset-packagist.org"
70-
}
71-
],
72-
"minimum-stability": "dev",
73-
"prefer-stable": true,
74-
"scripts": {
75-
"analyze": "phpstan analyze",
76-
"mutate": "infection --threads=2 --skip-initial-tests --coverage=build/phpunit",
77-
"style": "phpcbf --standard=./vendor/codeigniter4/codeigniter4-standard/CodeIgniter4 tests/ src/",
78-
"test": "phpunit"
79-
}
2+
"name": "tatter/files",
3+
"type": "library",
4+
"description": "File uploads and management, for CodeIgniter 4",
5+
"keywords": [
6+
"codeigniter",
7+
"codeigniter4",
8+
"files",
9+
"uploads",
10+
"dropzone"
11+
],
12+
"homepage": "https://github.com/tattersoftware/codeigniter4-files",
13+
"license": "MIT",
14+
"authors": [
15+
{
16+
"name": "Matthew Gatner",
17+
"email": "[email protected]",
18+
"homepage": "https://tattersoftware.com",
19+
"role": "Developer"
20+
}
21+
],
22+
"require": {
23+
"php": "^7.3 || ^8.0",
24+
"components/jquery": "^3.3",
25+
"enyo/dropzone": "^5.7",
26+
"fortawesome/font-awesome": "^5.8",
27+
"tatter/alerts": "^2.0",
28+
"tatter/assets": "^2.2",
29+
"tatter/audits": "^1.0",
30+
"tatter/exports": "^2.0",
31+
"tatter/permits": "^2.0",
32+
"tatter/settings": "^1.0 || ^2.0",
33+
"tatter/thumbnails": "^1.2",
34+
"twbs/bootstrap": "^4.5"
35+
},
36+
"require-dev": {
37+
"antecedent/patchwork": "^2.1",
38+
"codeigniter4/codeigniter4": "dev-develop",
39+
"codeigniter4/codeigniter4-standard": "^1.0",
40+
"myth/auth": "dev-develop",
41+
"tatter/tools": "^1.10"
42+
},
43+
"autoload": {
44+
"psr-4": {
45+
"Tatter\\Files\\": "src"
46+
},
47+
"exclude-from-classmap": [
48+
"**/Database/Migrations/**"
49+
]
50+
},
51+
"autoload-dev": {
52+
"psr-4": {
53+
"Tests\\Support\\": "tests/_support"
54+
}
55+
},
56+
"repositories": [
57+
{
58+
"type": "vcs",
59+
"url": "https://github.com/codeigniter4/CodeIgniter4",
60+
"no-api": true
61+
},
62+
{
63+
"type": "vcs",
64+
"url": "https://github.com/lonnieezell/myth-auth",
65+
"no-api": true
66+
},
67+
{
68+
"type": "composer",
69+
"url": "https://asset-packagist.org"
70+
}
71+
],
72+
"minimum-stability": "dev",
73+
"prefer-stable": true,
74+
"scripts": {
75+
"analyze": "phpstan analyze",
76+
"inspect": "deptrac analyze --cache-file=build/deptrac.cache",
77+
"mutate": "infection --threads=2 --skip-initial-tests --coverage=build/phpunit",
78+
"style": "php-cs-fixer fix --verbose --ansi",
79+
"test": "phpunit"
80+
}
8081
}

0 commit comments

Comments
 (0)