Skip to content

Commit

Permalink
Add dependency checker
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik committed Mar 17, 2021
1 parent d586748 commit c1776dd
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/dependency.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
on:
- pull_request
- push

name: dependency checker

jobs:
mutation:
name: PHP ${{ matrix.php }}-${{ matrix.os }}

runs-on: ${{ matrix.os }}

strategy:
matrix:
os:
- ubuntu-latest

php:
- "8.0"

steps:
- name: Checkout
uses: actions/checkout@v2.3.4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
tools: composer:v2, cs2pr
coverage: none

- name: Determine composer cache directory
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV

- name: Cache dependencies installed with composer
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Update composer
run: composer self-update

- name: Install dependencies with composer
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Check dependency
run: vendor/bin/composer-require-checker
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"yiisoft/json": "^1.0"
},
"require-dev": {
"maglnet/composer-require-checker": "^3.1",
"phpunit/phpunit": "^9.5",
"roave/infection-static-analysis-plugin": "^1.7",
"spatie/phpunit-watcher": "^1.23",
Expand Down
5 changes: 5 additions & 0 deletions dependency-checker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"scan-files": [
"src/*.php"
]
}

0 comments on commit c1776dd

Please sign in to comment.