-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run tests and checks on GutHub actions
- Loading branch information
Showing
4 changed files
with
100 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
tests: | ||
name: Tests (PHP ${{ matrix.php }}) | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- php: '8.0' | ||
composer-flags: '--prefer-stable --prefer-lowest' | ||
|
||
- php: '8.1' | ||
code-coverage: 'yes' | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: pcov | ||
|
||
- name: Install dependencies | ||
run: | | ||
composer update --no-interaction --no-progress --prefer-dist ${{ matrix.composer-flags }} | ||
composer info -D | ||
- name: Run tests | ||
if: matrix.code-coverage != 'yes' | ||
run: vendor/bin/phpunit ${{ matrix.phpunit-flags }} | ||
|
||
- name: Run tests with code coverage | ||
if: matrix.code-coverage == 'yes' | ||
run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml ${{ matrix.phpunit-flags }} | ||
|
||
- name: Upload coverage results to Coveralls | ||
if: matrix.code-coverage == 'yes' | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
composer global require php-coveralls/php-coveralls | ||
php-coveralls -v --coverage_clover=build/logs/clover.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Static analysis | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
php-cs-fixer: | ||
name: PHP-CS-Fixer | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.1' | ||
coverage: none | ||
extensions: mbstring | ||
tools: 'cs2pr' | ||
|
||
- name: Install dependencies | ||
run: composer update --no-interaction --no-progress --prefer-dist | ||
|
||
- name: Run PHP CS Fixer | ||
run: vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle | cs2pr | ||
|
||
psalm: | ||
name: Psalm | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.1' | ||
coverage: none | ||
extensions: mbstring, intl | ||
|
||
- name: Install dependencies | ||
run: composer update --no-interaction --no-progress --prefer-dist | ||
|
||
- name: Run Psalm | ||
run: vendor/bin/psalm --no-progress --output-format=github |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters