Skip to content

Commit

Permalink
Update toolkit
Browse files Browse the repository at this point in the history
  • Loading branch information
MGatner committed Aug 4, 2021
1 parent 4206eb2 commit e2d29bd
Show file tree
Hide file tree
Showing 8 changed files with 349 additions and 81 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/inspect.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# When a PR is opened or a push is made, perform an
# architectural inspection on the code using Deptrac.
name: Deptrac

on:
pull_request:
branches:
- 'develop'
paths:
- 'src/**'
- 'tests/**'
- 'composer.**'
- 'depfile.yaml'
- '.github/workflows/inspect.yml'
push:
branches:
- 'develop'
paths:
- 'src/**'
- 'tests/**'
- 'composer.**'
- 'depfile.yaml'
- '.github/workflows/inspect.yml'

jobs:
build:
name: PHP ${{ matrix.php-versions }} Architectural Inspection
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: ['7.4', '8.0']
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: composer, pecl, phive, phpunit
extensions: intl, json, mbstring, gd, mysqlnd, xdebug, xml, sqlite3
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Create composer cache directory
run: mkdir -p ${{ steps.composer-cache.outputs.dir }}

- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Create Deptrac cache directory
run: mkdir -p build/

- name: Cache Deptrac results
uses: actions/cache@v2
with:
path: build
key: ${{ runner.os }}-deptrac-${{ github.sha }}
restore-keys: ${{ runner.os }}-deptrac-

- 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: Run architectural inspection
run: |
sudo phive --no-progress install --global qossmic/deptrac --trust-gpg-keys B8F640134AB1782E
deptrac analyze --cache-file=build/deptrac.cache
4 changes: 1 addition & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,11 @@ jobs:
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
TACHYCARDIA_MONITOR_GA: enabled

- if: matrix.php-versions == '8.0'
name: Mutate with Infection
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();
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Tatter\Workflows
Job action control through dynamic workflows, for CodeIgniter 4

[![](https://github.com/tattersoftware/codeigniter4-workflows/workflows/PHPUnit/badge.svg)](https://github.com/tattersoftware/codeigniter4-workflows/actions?query=workflow%3A%22PHPUnit%22)
[![](https://github.com/tattersoftware/codeigniter4-workflows/workflows/PHPStan/badge.svg)](https://github.com/tattersoftware/codeigniter4-workflows/actions?query=workflow%3A%PHPStan%22)
[![](https://github.com/tattersoftware/codeigniter4-workflows/workflows/PHPUnit/badge.svg)](https://github.com/tattersoftware/codeigniter4-workflows/actions/workflows/test.yml)
[![](https://github.com/tattersoftware/codeigniter4-workflows/workflows/PHPStan/badge.svg)](https://github.com/tattersoftware/codeigniter4-workflows/actions/workflows/analyze.yml)
[![](https://github.com/tattersoftware/codeigniter4-workflows/workflows/Deptrac/badge.svg)](https://github.com/tattersoftware/codeigniter4-workflows/actions/workflows/inspect.yml)
[![Coverage Status](https://coveralls.io/repos/github/tattersoftware/codeigniter4-workflows/badge.svg?branch=develop)](https://coveralls.io/github/tattersoftware/codeigniter4-workflows?branch=develop)

## Quick Start
Expand Down
147 changes: 74 additions & 73 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,75 +1,76 @@
{
"name": "tatter/workflows",
"type": "library",
"description": "Job task control through dynamic workflows, for CodeIgniter 4",
"keywords": [
"codeigniter",
"codeigniter4",
"workflows",
"actions",
"jobs"
],
"homepage": "https://github.com/tattersoftware/codeigniter4-workflows",
"license": "MIT",
"authors": [
{
"name": "Matthew Gatner",
"email": "mgatner@tattersoftware.com",
"homepage": "https://tattersoftware.com",
"role": "Developer"
}
],
"require": {
"php": "^7.3 || ^8.0",
"codeigniter4/authentication-implementation": "1.0",
"components/jquery": "^3.3",
"fortawesome/font-awesome": "^5.8",
"npm-asset/sortablejs": "^1.10",
"tatter/alerts": "^2.0",
"tatter/assets": "^2.0",
"tatter/audits": "^1.0",
"tatter/handlers": "^2.0",
"tatter/users": "^1.0",
"twbs/bootstrap": "^4.3"
},
"require-dev": {
"codeigniter4/codeigniter4": "dev-develop",
"myth/auth": "dev-develop",
"tatter/tools": "^1.8"
},
"autoload": {
"psr-4": {
"Tatter\\Workflows\\": "src"
},
"exclude-from-classmap": [
"**/Database/Migrations/**"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\Support\\": "tests/_support"
}
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/codeigniter4/CodeIgniter4"
},
{
"type": "vcs",
"url": "https://github.com/lonnieezell/myth-auth"
},
{
"type": "composer",
"url": "https://asset-packagist.org"
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"analyze": "phpstan analyze",
"mutate": "infection --threads=2 --skip-initial-tests --coverage=build/phpunit",
"style": "phpcbf --standard=./vendor/codeigniter4/codeigniter4-standard/CodeIgniter4 tests/ src/",
"test": "phpunit"
}
"name": "tatter/workflows",
"type": "library",
"description": "Job task control through dynamic workflows, for CodeIgniter 4",
"keywords": [
"codeigniter",
"codeigniter4",
"workflows",
"actions",
"jobs"
],
"homepage": "https://github.com/tattersoftware/codeigniter4-workflows",
"license": "MIT",
"authors": [
{
"name": "Matthew Gatner",
"email": "mgatner@tattersoftware.com",
"homepage": "https://tattersoftware.com",
"role": "Developer"
}
],
"require": {
"php": "^7.3 || ^8.0",
"codeigniter4/authentication-implementation": "1.0",
"components/jquery": "^3.3",
"fortawesome/font-awesome": "^5.8",
"npm-asset/sortablejs": "^1.10",
"tatter/alerts": "^2.0",
"tatter/assets": "^2.0",
"tatter/audits": "^1.0",
"tatter/handlers": "^2.0",
"tatter/users": "^1.0",
"twbs/bootstrap": "^4.3"
},
"require-dev": {
"codeigniter4/codeigniter4": "dev-develop",
"myth/auth": "dev-develop",
"tatter/tools": "^1.10"
},
"autoload": {
"psr-4": {
"Tatter\\Workflows\\": "src"
},
"exclude-from-classmap": [
"**/Database/Migrations/**"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\Support\\": "tests/_support"
}
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/codeigniter4/CodeIgniter4"
},
{
"type": "vcs",
"url": "https://github.com/lonnieezell/myth-auth"
},
{
"type": "composer",
"url": "https://asset-packagist.org"
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"analyze": "phpstan analyze",
"inspect": "deptrac analyze --cache-file=build/deptrac.cache",
"mutate": "infection --threads=2 --skip-initial-tests --coverage=build/phpunit",
"style": "php-cs-fixer fix --verbose --ansi",
"test": "phpunit"
}
}

0 comments on commit e2d29bd

Please sign in to comment.