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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/.scrutinizer.yml export-ignore
/.php-cs-fixer.dist.php export-ignore
/kahlan-config.php export-ignore
/phpstan.neon.dist export-ignore
/phpstan-baseline.php export-ignore
10 changes: 5 additions & 5 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:

- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.6.0
uses: dependabot/fetch-metadata@v2.0.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Auto-merge Dependabot PRs for semver-minor updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Auto-merge Dependabot PRs for semver-patch updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
19 changes: 13 additions & 6 deletions .github/workflows/fix-php-code-style-issues.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Check & fix styling

on: [push]
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'

permissions:
contents: write
Expand All @@ -15,12 +21,13 @@ jobs:
with:
ref: ${{ github.head_ref }}

- name: Run PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php-cs-fixer.dist.php --allow-risky=yes
- name: Install Composer packages
run: composer update --ansi --no-interaction

- name: Run PHP-CS-Fixer Lint
run: vendor/bin/php-cs-fixer fix

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Fix styling
commit_message: Fix styling
21 changes: 20 additions & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
name: Tests

on: [push, pull_request]
on:
push:
branches:
- 'devs'
paths:
- 'src/**.php'
- 'spec/**.php'
- composer.json
- kahlan-config.php
- .github/workflows/run-tests.yml

pull_request:
branches:
- 'devs'
paths:
- 'src/**.php'
- 'spec/**.php'
- composer.json
- kahlan-config.php
- .github/workflows/run-tests.yml

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/test-coding-standards.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Coding Standards

on:
schedule:
- cron: '0 0 * * *'
pull_request:
paths:
- '**.php'
Expand All @@ -15,10 +13,10 @@ on:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
lint:
name: PHP ${{ matrix.php-version }} Lint with PHP CS Fixer
Expand Down Expand Up @@ -54,11 +52,8 @@ jobs:
${{ runner.os }}-${{ matrix.php-version }}-
${{ runner.os }}-

- name: Setup Composer's GitHub OAuth access
run: composer config --global github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: composer update --ansi --no-interaction

- name: Run PHP CS Fixer
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --using-cache=no --diff
- name: Run lint
run: composer cs
19 changes: 9 additions & 10 deletions .github/workflows/test-phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
name: PHPStan

on:
schedule:
- cron: '0 0 * * *'
pull_request:
branches:
- 'devs'
paths:
- 'src/**.php'
- composer.json
- phpstan.neon.dist
- phpstan-baseline.php
- '.github/workflows/test-phpstan.yml'
push:
branches:
- 'devs'
paths:
- 'src/**.php'
- composer.json
Expand All @@ -29,7 +31,7 @@ permissions:

jobs:
build:
name: PHP ${{ matrix.php-version }} Static Analysis
name: PHP ${{ matrix.php-versions }} Static Analysis
runs-on: ubuntu-22.04
strategy:
fail-fast: false
Expand All @@ -49,7 +51,7 @@ jobs:

- name: Validate composer.json
run: composer validate --strict

- name: Get composer cache directory
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV

Expand All @@ -58,7 +60,7 @@ jobs:
with:
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: composer-${{ runner.os }}-
restore-keys: ${{ runner.os }}-composer-

- name: Create PHPStan result cache directory
run: mkdir -p build/phpstan
Expand All @@ -70,11 +72,8 @@ jobs:
key: ${{ runner.os }}-phpstan-${{ github.sha }}
restore-keys: ${{ runner.os }}-phpstan-

- name: Setup Composer's GitHub OAuth access
run: composer config --global github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: composer update --ansi --no-interaction

- name: Run PHPStan
run: vendor/bin/phpstan analyse
- name: Run static analysis
run: composer phpstan:check
2 changes: 1 addition & 1 deletion .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
with:
branch: main
commit_message: Update CHANGELOG
file_pattern: CHANGELOG.md
file_pattern: CHANGELOG.md
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
"Composer\\Config::disableProcessTimeout",
"vendor/bin/kahlan --coverage=4 --reporter=verbose --clover=clover.xml"
],
"cs": [
"Composer\\Config::disableProcessTimeout",
"php-cs-fixer check --ansi --verbose --diff"
],
"cs:fix": [
"Composer\\Config::disableProcessTimeout",
"vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --allow-risky=yes"
Expand All @@ -58,7 +62,8 @@
},
"scripts-descriptions": {
"test": "Execute les tests unitaires",
"cs:fix": "Corriger le style de codage",
"cs": "Verifie le style de codage",
"cs:fix": "Corrige le style de codage",
"phpstan:baseline": "Exécute PHPStan puis transférer toutes les erreurs vers le fichier de baseline",
"phpstan:check": "Exécute PHPStan avec la prise en charge des identifiants"
},
Expand Down
Loading
Loading