Skip to content

Commit ff0b736

Browse files
committed
Switch to CodeIgniter DevKit
1 parent 268cee7 commit ff0b736

19 files changed

+860
-144
lines changed

.github/workflows/analyze.yml

-81
This file was deleted.

.github/workflows/deptrac.yml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Deptrac
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
paths:
8+
- '**.php'
9+
- 'composer.*'
10+
- 'depfile.yaml'
11+
- '.github/workflows/deptrac.yml'
12+
push:
13+
branches:
14+
- develop
15+
paths:
16+
- '**.php'
17+
- 'composer.*'
18+
- 'depfile.yaml'
19+
- '.github/workflows/deptrac.yml'
20+
21+
jobs:
22+
build:
23+
name: Dependency Tracing
24+
runs-on: ubuntu-latest
25+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
26+
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v3
30+
31+
- name: Set up PHP
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: '8.0'
35+
tools: phive
36+
extensions: intl, json, mbstring, xml
37+
coverage: none
38+
env:
39+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Get composer cache directory
42+
id: composer-cache
43+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
44+
45+
- name: Cache composer dependencies
46+
uses: actions/cache@v3
47+
with:
48+
path: ${{ steps.composer-cache.outputs.dir }}
49+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
50+
restore-keys: ${{ runner.os }}-composer-
51+
52+
- name: Create Deptrac cache directory
53+
run: mkdir -p build/
54+
55+
- name: Cache Deptrac results
56+
uses: actions/cache@v3
57+
with:
58+
path: build
59+
key: ${{ runner.os }}-deptrac-${{ github.sha }}
60+
restore-keys: ${{ runner.os }}-deptrac-
61+
62+
- name: Install dependencies
63+
run: |
64+
if [ -f composer.lock ]; then
65+
composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
66+
else
67+
composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
68+
fi
69+
70+
- name: Trace dependencies
71+
run: |
72+
sudo phive --no-progress install --global --trust-gpg-keys B8F640134AB1782E,A98E898BB53EB748 qossmic/deptrac
73+
deptrac analyze --cache-file=build/deptrac.cache

.github/workflows/infection.yml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Infection
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
paths:
8+
- '**.php'
9+
- 'composer.*'
10+
- 'phpunit*'
11+
- '.github/workflows/infection.yml'
12+
push:
13+
branches:
14+
- develop
15+
paths:
16+
- '**.php'
17+
- 'composer.*'
18+
- 'phpunit*'
19+
- '.github/workflows/infection.yml'
20+
21+
jobs:
22+
main:
23+
name: Mutation Testing
24+
runs-on: ubuntu-latest
25+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
26+
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v3
30+
31+
- name: Set up PHP
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: '8.0'
35+
tools: infection, phpunit
36+
extensions: intl, json, mbstring, gd, xml, sqlite3
37+
coverage: xdebug
38+
env:
39+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Set up problem matchers for PHPUnit
42+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
43+
44+
- name: Configure matchers
45+
uses: mheap/phpunit-matcher-action@v1
46+
47+
- name: Get composer cache directory
48+
id: composer-cache
49+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
50+
51+
- name: Cache composer dependencies
52+
uses: actions/cache@v3
53+
with:
54+
path: ${{ steps.composer-cache.outputs.dir }}
55+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
56+
restore-keys: ${{ runner.os }}-composer-
57+
58+
- name: Install dependencies
59+
run: |
60+
if [ -f composer.lock ]; then
61+
composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
62+
else
63+
composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
64+
fi
65+
66+
- name: Test with PHPUnit
67+
run: vendor/bin/phpunit --teamcity
68+
69+
- name: Mutate with Infection
70+
run: |
71+
git fetch --depth=1 origin $GITHUB_BASE_REF
72+
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

.github/workflows/phpcpd.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: PHPCPD
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
paths:
8+
- '**.php'
9+
- '.github/workflows/phpcpd.yml'
10+
push:
11+
branches:
12+
- develop
13+
paths:
14+
- '**.php'
15+
- '.github/workflows/phpcpd.yml'
16+
17+
jobs:
18+
build:
19+
name: Code Copy-Paste Detection
20+
runs-on: ubuntu-latest
21+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
22+
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v3
26+
27+
- name: Setup PHP
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: '8.0'
31+
tools: phpcpd
32+
extensions: dom, mbstring
33+
coverage: none
34+
35+
- name: Detect duplicate code
36+
run: phpcpd src/ tests/

.github/workflows/phpcsfixer.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: PHPCSFixer
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
paths:
8+
- '**.php'
9+
- '.github/workflows/phpcsfixer.yml'
10+
push:
11+
branches:
12+
- develop
13+
paths:
14+
- '**.php'
15+
- '.github/workflows/phpcsfixer.yml'
16+
17+
jobs:
18+
build:
19+
name: PHP ${{ matrix.php-versions }} Coding Standards
20+
runs-on: ubuntu-latest
21+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
php-versions: ['7.4', '8.0', '8.1']
26+
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v3
30+
31+
- name: Set up PHP
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: ${{ matrix.php-versions }}
35+
extensions: json, tokenizer
36+
coverage: none
37+
env:
38+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
40+
- name: Get composer cache directory
41+
id: composer-cache
42+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
43+
44+
- name: Cache composer dependencies
45+
uses: actions/cache@v3
46+
with:
47+
path: ${{ steps.composer-cache.outputs.dir }}
48+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
49+
restore-keys: ${{ runner.os }}-composer-
50+
51+
- name: Install dependencies
52+
run: |
53+
if [ -f composer.lock ]; then
54+
composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
55+
else
56+
composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
57+
fi
58+
59+
- name: Check code for standards compliance
60+
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --using-cache=no --diff

0 commit comments

Comments
 (0)