Skip to content

Commit c90e52d

Browse files
authored
Merge pull request #98 from samsonasik/migrate-to-structarmed
chore: migrate from deptrac to structarmed
2 parents 87f736a + 30fb041 commit c90e52d

18 files changed

Lines changed: 157 additions & 230 deletions

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ CONTRIBUTING.md export-ignore
2020
tests/AutoReview/ export-ignore
2121
tests/system/ export-ignore
2222
utils/ export-ignore
23-
deptrac.yaml export-ignore
23+
structarmed.php export-ignore
2424
rector.php export-ignore
2525
phpunit.xml.dist export-ignore
2626
phpstan-baseline.neon.dist export-ignore

.github/workflows/deptrac.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/structarmed.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: StructArmed
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
paths:
8+
- '**.php'
9+
- 'composer.*'
10+
- 'structarmed.php'
11+
- '.github/workflows/structarmed.yml'
12+
push:
13+
branches:
14+
- develop
15+
paths:
16+
- '**.php'
17+
- 'composer.*'
18+
- 'structarmed.php'
19+
- '.github/workflows/structarmed.yml'
20+
workflow_call:
21+
inputs:
22+
php-version:
23+
required: false
24+
type: string
25+
default: '8.2'
26+
27+
permissions:
28+
contents: read
29+
30+
jobs:
31+
build:
32+
name: Dependency Tracing
33+
runs-on: ubuntu-latest
34+
if: (! contains(github.event.head_commit.message, '[ci skip]'))
35+
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
39+
40+
- name: Set up PHP
41+
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2
42+
with:
43+
php-version: ${{ inputs['php-version'] }}
44+
tools: composer
45+
extensions: intl, json, mbstring, xml
46+
coverage: none
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Get composer cache directory
51+
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
52+
53+
- name: Cache composer dependencies
54+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 #v6.1.0
55+
with:
56+
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
57+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
58+
restore-keys: ${{ runner.os }}-composer-
59+
60+
- name: Install dependencies
61+
run: |
62+
if [ -f composer.lock ]; then
63+
composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
64+
else
65+
composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
66+
fi
67+
68+
- name: Structarmed Cache
69+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
70+
with:
71+
path: /tmp/structarmed
72+
key: ${{ runner.os }}-structarmed-${{ github.run_id }}
73+
restore-keys: ${{ runner.os }}-structarmed-
74+
75+
- run: mkdir -p /tmp/structarmed
76+
77+
- name: Run static analysis
78+
run: vendor/bin/structarmed analyze

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Queues for the CodeIgniter 4 framework.
44

55
[![PHPUnit](https://github.com/codeigniter4/queue/actions/workflows/phpunit.yml/badge.svg)](https://github.com/codeigniter4/queue/actions/workflows/phpunit.yml)
66
[![PHPStan](https://github.com/codeigniter4/queue/actions/workflows/phpstan.yml/badge.svg)](https://github.com/codeigniter4/queue/actions/workflows/phpstan.yml)
7-
[![Deptrac](https://github.com/codeigniter4/queue/actions/workflows/deptrac.yml/badge.svg)](https://github.com/codeigniter4/queue/actions/workflows/deptrac.yml)
7+
[![StructArmed](https://github.com/codeigniter4/queue/actions/workflows/structarmed.yml/badge.svg)](https://github.com/codeigniter4/queue/actions/workflows/structarmed.yml)
88
[![Coverage Status](https://coveralls.io/repos/github/codeigniter4/queue/badge.svg?branch=develop)](https://coveralls.io/github/codeigniter4/queue?branch=develop)
99

1010
![PHP](https://img.shields.io/badge/PHP-%5E8.2-blue)

composer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"codeigniter4/framework": "^4.3",
2121
"predis/predis": "^2.0 || ^3.0",
2222
"phpstan/phpstan-strict-rules": "^2.0",
23-
"php-amqplib/php-amqplib": "^3.7"
23+
"php-amqplib/php-amqplib": "^3.7",
24+
"boundwize/structarmed": "^0.17.3"
2425
},
2526
"minimum-stability": "dev",
2627
"prefer-stable": true,
@@ -34,7 +35,8 @@
3435
},
3536
"autoload-dev": {
3637
"psr-4": {
37-
"Tests\\": "tests"
38+
"Tests\\": "tests",
39+
"Tests\\Support\\": "tests/_support"
3840
}
3941
},
4042
"suggest": {
@@ -66,7 +68,7 @@
6668
"cs-fix": "php-cs-fixer fix --ansi --verbose --diff",
6769
"style": "@cs-fix",
6870
"deduplicate": "phpcpd src/ tests/",
69-
"inspect": "deptrac analyze --cache-file=build/deptrac.cache",
71+
"inspect": "vendor/bin/structarmed analyze",
7072
"mutate": "infection --threads=2 --skip-initial-tests --coverage=build/phpunit",
7173
"test": "phpunit"
7274
}

deptrac.yaml

Lines changed: 0 additions & 156 deletions
This file was deleted.

0 commit comments

Comments
 (0)