Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:

# Maintain dependencies for Composer
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "weekly"

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
84 changes: 84 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: 'Run tests'

on:
pull_request:
paths:
- '**/*.php'
- '.github/workflows/*'
push:
paths:
- '**/*.php'
- '.github/workflows/*'

jobs:
cs:
name: 'Check coding style'
runs-on: 'ubuntu-22.04'

steps:
- name: 'Checkout current revision'
uses: 'actions/checkout@v3'

- name: 'Setup PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '8.1'
tools: 'composer'
extensions: 'mbstring, intl'
coverage: 'none'

- name: 'Discover Composer cache directory'
id: 'cachedir'
run: 'echo "::set-output name=path::$(composer global config cache-dir)"'

- name: 'Share Composer cache across runs'
uses: 'actions/cache@v3'
with:
path: '${{ steps.cachedir.outputs.path }}'
key: "composer-${{ github.job }}-${{ hashFiles('**/composer.json') }}"
restore-keys: |
composer-${{ github.job }}-
composer-

- name: 'Install dependencies with Composer'
run: 'composer install --prefer-dist --no-interaction'

- name: 'Run PHP CodeSniffer'
run: 'composer run-script cs-check -- -n'

stan:
name: 'Static code analyzer'
runs-on: 'ubuntu-22.04'
continue-on-error: true

steps:
- name: 'Checkout current revision'
uses: 'actions/checkout@v3'

- name: 'Setup PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '8.1'
tools: 'composer, phpstan'
extensions: 'mbstring, intl'
coverage: 'none'

- name: 'Discover Composer cache directory'
id: 'cachedir'
run: 'echo "::set-output name=path::$(composer global config cache-dir)"'

- name: 'Share Composer cache across runs'
uses: 'actions/cache@v3'
with:
path: '${{ steps.cachedir.outputs.path }}'
key: "composer-${{ github.job }}-${{ hashFiles('**/composer.json') }}"
restore-keys: |
composer-${{ github.job }}-
composer-

- name: 'Install dependencies with Composer'
run: 'composer install --prefer-dist --no-interaction'

- name: 'Run PHP STAN'
run: |
phpstan analyse --no-progress src
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"license": "MIT",
"require": {
"php": ">=7.4",
"cakephp/cakephp": "~4.2.0",
"cakephp/cakephp": "^4.2",
"cakephp/migrations": "^3.0",
"brick/geo": "^0.7.1"
},
"require-dev": {
"cakephp/cakephp-codesniffer": "~4.2.0",
"cakephp/cakephp-codesniffer": "^4.2",
"phpunit/phpunit": "^8.5 || ^9.3"
},
"autoload": {
Expand All @@ -33,5 +33,10 @@
"cs-fix": "phpcbf --colors -p src/ tests/",
"stan": "phpstan analyse",
"test": "phpunit --colors=always"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}