Skip to content

Commit

Permalink
Bump tools and switch to reusable workflows (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus authored Apr 24, 2022
1 parent 1adcddc commit 7077641
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 52 deletions.
57 changes: 7 additions & 50 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,55 +6,12 @@ on:
jobs:

coding-standards:
name: "Coding Standards"
runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"

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

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

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v1"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"

- name: "Install dependencies with composer"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Run squizlabs/php_codesniffer"
run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr"
uses: "doctrine/.github/.github/workflows/[email protected]"
with:
php-version: "8.1"

phpunit:
name: PHPUnit
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['7.1', '7.2', '7.3', '7.4']
steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: Setup PHP
uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php-version }}

- name: "Install dependencies with composer"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: PHPUnit
run: "vendor/bin/phpunit"
name: "PHPUnit"
uses: "doctrine/.github/.github/workflows/[email protected]"
with:
php-versions: '["7.1", "7.2", "7.3", "7.4", "8.0", "8.1"]'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
vendor
.phpcs-cache
.phpunit.result.cache
composer.lock
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"php": "^7.1|^8.0"
},
"require-dev": {
"phpunit/phpunit": "^7.0|^8.0|^9.0",
"phpunit/phpunit": "^7.5|^8.5|^9.5",
"psr/log": "^1.0",
"doctrine/coding-standard": "^6.0|^7.0|^8.0"
"doctrine/coding-standard": "^9"
},
"suggest": {
"psr/log": "Allows logging deprecations via PSR-3 logger implementation"
Expand All @@ -23,5 +23,10 @@
"DeprecationTests\\": "test_fixtures/src",
"Doctrine\\Foo\\": "test_fixtures/vendor/doctrine/foo"
}
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
2 changes: 2 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<!-- Ignore warnings, show progress of the run and show sniff names -->
<arg value="nps"/>

<config name="php_version" value="70100"/>

<!-- Directories to be checked -->
<file>lib</file>
<file>tests</file>
Expand Down

0 comments on commit 7077641

Please sign in to comment.