Skip to content

Commit

Permalink
Reuse .github CI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
vudaltsov committed Sep 9, 2024
1 parent b8d7fa0 commit 8d32073
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 87 deletions.
98 changes: 11 additions & 87 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,96 +1,20 @@
name: Check

on:
push:
branches: ['main', '*.*.x']
pull_request: ~

jobs:
composer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: 8.1
tools: composer:v2
coverage: none
- uses: ramsey/composer-install@v3
with:
composer-options: --optimize-autoloader
- run: composer validate
- run: composer normalize --dry-run
- run: composer check-require
- run: composer check-unused

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: 8.1
tools: composer:v2
coverage: none
- uses: ramsey/composer-install@v3
with:
composer-options: --optimize-autoloader
- run: composer fixcs -- --dry-run --format=checkstyle

uses: typhoon-php/.github/.github/workflows/composer.yml@main
php-cs-fixer:
uses: typhoon-php/.github/.github/workflows/php-cs-fixer.yml@main
psalm:
runs-on: ubuntu-latest
strategy:
matrix:
dependency-versions: [locked, lowest, highest]
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: 8.1
tools: composer:v2
coverage: none
- uses: ramsey/composer-install@v3
with:
composer-options: --optimize-autoloader
dependency-versions: ${{ matrix.dependency-versions }}
- run: composer psalm -- --stats --output-format=github ${{ matrix.dependency-versions == 'locked' && '--shepherd' || '' }}

test:
runs-on: ubuntu-latest
strategy:
matrix:
php: [8.1, 8.2, 8.3]
dependency-versions: [locked, lowest, highest]
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-file: development
tools: composer:v2
coverage: ${{ matrix.php == '8.1' && matrix.dependency-versions == 'locked' && 'pcov' || '' }}
- uses: ramsey/composer-install@v3
with:
composer-options: --optimize-autoloader
dependency-versions: ${{ matrix.dependency-versions }}
- run: composer test -- --colors=always --coverage-clover coverage.xml
- if: ${{ matrix.php == '8.1' && matrix.dependency-versions == 'locked' }}
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

uses: typhoon-php/.github/.github/workflows/psalm.yml@main
phpunit:
uses: typhoon-php/.github/.github/workflows/phpunit.yml@main
# secrets:
# codecov-token: XXX
infection:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: 8.1
ini-file: development
tools: composer:v2
- uses: ramsey/composer-install@v3
with:
composer-options: --optimize-autoloader
- run: composer infection
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
uses: typhoon-php/.github/.github/workflows/infection.yml@main
# secrets:
# stryker-api-key: XXX
10 changes: 10 additions & 0 deletions .github/workflows/sync-repo-description.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
on:
push:
branches: ['main', '*.*.x']
paths:
- composer.json

jobs:
sync-repo-description:
if: github.ref_name == github.event.repository.default_branch
uses: typhoon-php/.github/.github/workflows/sync-repo-description.yml@main

0 comments on commit 8d32073

Please sign in to comment.