Skip to content

Commit

Permalink
Upgrade to newest API
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Jun 10, 2024
1 parent 5c971f4 commit 3d1fc4f
Show file tree
Hide file tree
Showing 42 changed files with 1,129 additions and 486 deletions.
30 changes: 0 additions & 30 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,42 +1,12 @@
root = true

[*]
# Change these settings to your own preference
indent_style = space
indent_size = 4

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true


[*.json]
indent_style = space
indent_size = 2

[*.md]
indent_style = space
indent_size = 4
trim_trailing_whitespace = false

[*.neon]
indent_style = tab
indent_size = 4

[*.php]
indent_style = space
indent_size = 4

[composer.json]
indent_style = space
indent_size = 4

[phpstan.neon]
indent_style = tab
indent_size = 4

[phpunit.xml{,.dist}]
indent_style = space
indent_size = 4
31 changes: 16 additions & 15 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
/etc export-ignore
/features export-ignore
/spec export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.scrutinizer.yml export-ignore
/.travis.yml export-ignore
/behat.yml.dist export-ignore
/easy-coding-standard.yaml export-ignore
/phpspec.yml.dist export-ignore
/phpstan.neon export-ignore
/phpunit.xml.dist export-ignore
/README.md export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore
/README.md export-ignore
/behat.yml.dist export-ignore
/composer-require-checker.json export-ignore
/docs export-ignore
/ecs.php export-ignore
/node_modules export-ignore
/phpunit.xml.dist export-ignore
/psalm-baseline.xml export-ignore
/psalm.xml export-ignore
/tests export-ignore
/rector.php export-ignore
/infection.json.dist export-ignore
263 changes: 223 additions & 40 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,46 +1,229 @@
name: build
name: "build"
on:
push: ~
push:
branches:
- "*.x"
pull_request: ~
schedule:
- cron: 5 8 * * 5
workflow_dispatch: ~

jobs:
checks:
name: 'PHP ${{ matrix.php-versions }} with composer args: ${{ matrix.composer-args }}'
runs-on: ${{ matrix.operating-system }}
coding-standards:
name: "Coding Standards"

runs-on: "ubuntu-latest"

strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.2', '7.3', '7.4']
composer-args: ['--prefer-lowest --prefer-stable', '']
php-version:
- "8.1"

dependencies:
- "highest"

steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring
coverage: none
tools: composer-require-checker, composer-unused
- name: Install Composer dependencies
run: composer update --no-progress --no-suggest --prefer-dist --no-interaction ${{ matrix.composer-args }}
- name: Validate composer
run: composer validate --strict
- name: Check composer normalized
run: composer normalize --dry-run
- name: Check style
run: composer check-style
- name: Static analysis
run: composer analyse
- name: Run phpspec
run: composer phpspec
- name: Run phpunit
run: composer phpunit
- name: Composer require checker
if: matrix.php-versions == '7.4' && matrix.composer-args == ''
run: composer-require-checker
- name: Composer unused checker
if: matrix.php-versions == '7.4' && matrix.composer-args == ''
run: composer-unused
- name: "Checkout"
uses: "actions/checkout@v4"

- name: "Setup PHP, with composer and extensions"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: "${{ env.PHP_EXTENSIONS }}"
coverage: "none"

- name: "Install composer dependencies"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Validate composer"
run: "composer validate --strict"

- name: "Check composer normalized"
run: "composer normalize --dry-run"

- name: "Check style"
run: "composer check-style"

dependency-analysis:
name: "Dependency Analysis"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"

dependencies:
- "lowest"
- "highest"

steps:
- name: "Checkout"
uses: "actions/checkout@v4"

- name: "Setup PHP, with composer and extensions"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"
tools: "composer-require-checker, composer-unused"

- name: "Install composer dependencies"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Run maglnet/composer-require-checker"
run: "composer-require-checker check"

- name: "Run composer-unused/composer-unused"
run: "composer-unused"

static-code-analysis:
name: "Static Code Analysis"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"

dependencies:
- "lowest"
- "highest"

steps:
- name: "Checkout"
uses: "actions/checkout@v4"

- name: "Setup PHP, with composer and extensions"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: "${{ env.PHP_EXTENSIONS }}"
coverage: "none"

- name: "Install composer dependencies"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Static analysis"
run: "composer analyse"

unit-tests:
name: "Unit tests"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"

dependencies:
- "lowest"
- "highest"

steps:
- name: "Checkout"
uses: "actions/checkout@v4"

- name: "Setup PHP, with composer and extensions"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: "${{ env.PHP_EXTENSIONS }}"
coverage: "none"

- name: "Install composer dependencies"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Run phpunit"
run: "composer phpunit"

code-coverage:
name: "Code Coverage"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "8.3"

dependencies:
- "highest"

steps:
- name: "Checkout"
uses: "actions/checkout@v4"

- name: "Setup PHP, with composer and extensions"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

- name: "Set up problem matchers for phpunit/phpunit"
run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\""

- name: "Install composer dependencies"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Collect code coverage with pcov and phpunit/phpunit"
run: "vendor/bin/phpunit --coverage-clover=.build/logs/clover.xml"

- name: "Send code coverage report to Codecov.io"
env:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
run: "bash <(curl -s https://codecov.io/bash)"

mutation-tests:
name: "Mutation tests"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "8.3"

dependencies:
- "highest"

steps:
- name: "Checkout"
uses: "actions/checkout@v4"

- name: "Setup PHP, with composer and extensions"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

- name: "Install composer dependencies"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Run infection"
run: "vendor/bin/infection"
env:
STRYKER_DASHBOARD_API_KEY: "${{ secrets.STRYKER_DASHBOARD_API_KEY }}"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/composer.lock
/.phpunit.result.cache
/phpunit.xml
/.build/
12 changes: 0 additions & 12 deletions .scrutinizer.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Setono
Copyright (c) 2023 Setono

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit 3d1fc4f

Please sign in to comment.