Skip to content

Commit

Permalink
Merge pull request #85 from denniscoorn/feature/php-81-compatibility
Browse files Browse the repository at this point in the history
Support and compatibility added for PHP 8.1
  • Loading branch information
christiaan authored Sep 6, 2023
2 parents 64e6a8a + b00b00f commit 3704dbb
Show file tree
Hide file tree
Showing 15 changed files with 622 additions and 626 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[Makefile]
indent_style = tab

[*.{yml,yaml,yaml.dist}]
indent_size = 2
23 changes: 9 additions & 14 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
release:
# Every published release will trigger a distribution app build which will
# added to the release a asset.
# added to the release an asset.
types: [published]

env:
Expand All @@ -18,25 +18,20 @@ jobs:
with:
fetch-depth: 0

- name: Setup PHP with Composer v1
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
tools: composer:v1
# It's important to use the lowest supported PHP version when building the release-tool.
# Otherwise, users can be confronted with a composer platform check error when they use
# a PHP version that's lower than the version used here to build the release-tool.
php-version: '7.4'

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Composer Install
uses: ramsey/composer-install@v2

- name: Create build
run: make dist

- uses: actions/upload-release-asset@v1
if: github.event_name == 'release'
env:
Expand Down
25 changes: 3 additions & 22 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,13 @@ jobs:
- name: checkout
uses: actions/checkout@v3

- name: Setup PHP with Composer v1
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer:v1

- name: Authenticate npm
env:
COMPOSER_GITHUB_TOKEN: ${{ secrets.COMPOSER_GITHUB_TOKEN }}
run: |
npm config set "@leviy:registry" "https://npm.pkg.github.com" \
&& npm config set "//npm.pkg.github.com/:_authToken" "$COMPOSER_GITHUB_TOKEN"

- name: Composer Install
run: composer install --no-interaction --no-progress --no-ansi

- name: Npm Install
run: npm install --silent --no-fund --no-audit
uses: ramsey/composer-install@v2

- name: Test
run: make static-analysis unit-tests acceptance-tests
Expand All @@ -41,18 +30,10 @@ jobs:
- name: checkout
uses: actions/checkout@v3

- name: Setup PHP with Composer v1
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer:v1

- name: Authenticate npm
env:
COMPOSER_GITHUB_TOKEN: ${{ secrets.COMPOSER_GITHUB_TOKEN }}
run: |
npm config set "@leviy:registry" "https://npm.pkg.github.com" \
&& npm config set "//npm.pkg.github.com/:_authToken" "$COMPOSER_GITHUB_TOKEN"

- name: Security checks
run: make security-tests
56 changes: 8 additions & 48 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,65 +5,25 @@ env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_GITHUB_AUTH }}

jobs:
test_php7-3:
test:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3

- name: Setup PHP with Composer v1
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
tools: composer:v1

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Composer Install
run: composer install --no-interaction --no-progress --no-ansi

- name: Test
run: make static-analysis unit-tests acceptance-tests coding-standards
strategy:
fail-fast: true
matrix:
php: [ 7.4, 8.0, 8.1 ]

- name: Integration tests
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
make integration-tests
test_php8:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3

- name: Setup PHP with Composer v1
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
tools: composer:v1

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
php-version: ${{ matrix.php }}

- name: Composer Install
run: composer install --no-interaction --no-progress --no-ansi
uses: ramsey/composer-install@v2

- name: Test
run: make static-analysis unit-tests acceptance-tests coding-standards
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ coding-standards: vendor
security-tests: vendor bin/local-security-checker
bin/local-security-checker

security_checker_binary = local-php-security-checker_1.0.0_linux_amd64
security_checker_binary = local-php-security-checker_2.0.6_linux_amd64
ifeq ($(shell uname -s), Darwin)
security_checker_binary = local-php-security-checker_1.0.0_darwin_amd64
security_checker_binary = local-php-security-checker_2.0.6_darwin_amd64
endif

bin/local-security-checker:
curl -LS https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/$(security_checker_binary) -o bin/local-security-checker
curl -LS https://github.com/fabpot/local-php-security-checker/releases/download/v2.0.6/$(security_checker_binary) -o bin/local-security-checker
chmod a+x bin/local-security-checker

bin/box.phar:
curl -LS https://github.com/humbug/box/releases/download/3.14.0/box.phar -o bin/box.phar
curl -LS https://github.com/humbug/box/releases/download/3.16.0/box.phar -o bin/box.phar
chmod a+x bin/box.phar
13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,28 @@
"description": "Command line tool for releasing new versions of a project",
"license": "MIT",
"require": {
"php": "^7.3||^8.0",
"php": "^7.4 || ^8.0, <8.2",
"beberlei/assert": "^3.2",
"consolidation/self-update": "^2.0",
"guzzlehttp/guzzle": "^6.3",
"padraic/phar-updater": "^1.0",
"symfony/config": "^5.0",
"symfony/console": "^5.0",
"symfony/dependency-injection": "^5.0",
"symfony/yaml": "^5.0"
},
"require-dev": {
"behat/behat": "^3.4",
"behat/behat": "^3.12",
"leviy/coding-standard": "^4.0",
"mockery/mockery": "^1.1",
"phpstan/phpstan": "^0.12.14",
"phpstan/phpstan": "^1.9",
"phpunit/phpunit": "^9.0",
"symfony/process": "^5.0"
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit 3704dbb

Please sign in to comment.