-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from inpsyde/workflows
GitHub Actions Workflows
- Loading branch information
Showing
3 changed files
with
92 additions
and
83 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 |
---|---|---|
@@ -1,27 +1,27 @@ | ||
name: PHPStan | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
PHP_VERSION: | ||
description: PHP version which PHPStan will be executed on. | ||
default: '8.1' | ||
required: false | ||
type: string | ||
workflow_call: | ||
inputs: | ||
PHP_VERSION: | ||
description: PHP version which PHPStan will be executed on. | ||
default: '8.1' | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
phpstan: | ||
timeout-minutes: 5 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ inputs.PHP_VERSION }} | ||
tools: composer, cs2pr | ||
coverage: none | ||
- run: composer validate | ||
- uses: ramsey/composer-install@v3 | ||
with: | ||
composer-options: '--prefer-dist' | ||
- run: ./vendor/bin/phpstan analyse --no-progress --memory-limit=1G | ||
phpstan: | ||
timeout-minutes: 5 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ inputs.PHP_VERSION }} | ||
tools: composer, cs2pr | ||
coverage: none | ||
- run: composer validate | ||
- uses: ramsey/composer-install@v3 | ||
with: | ||
composer-options: '--prefer-dist' | ||
- run: ./vendor/bin/phpstan analyse --no-progress --memory-limit=1G |
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,9 @@ | ||
name: Lint GitHub Actions Workflows | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
lint-workflows: | ||
uses: inpsyde/reusable-workflows/.github/workflows/lint-workflows.yml@main |
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 |
---|---|---|
@@ -1,71 +1,71 @@ | ||
name: PHP Quality Assurance | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'Syde/**' | ||
- 'tests/**' | ||
- '**ruleset.xml' | ||
- '.github/workflows/quality-assurance-php.yml' | ||
- 'composer.json' | ||
- 'phpcs.xml' | ||
- 'phpstan.neon.dist' | ||
- 'phpunit.xml.dist' | ||
workflow_dispatch: | ||
inputs: | ||
jobs: | ||
required: true | ||
type: choice | ||
default: 'Run all' | ||
description: 'Choose jobs to run' | ||
options: | ||
- 'Run all' | ||
- 'Run lint only' | ||
- 'Run PHPCS only' | ||
- 'Run PHPStan only' | ||
- 'Run static analysis' | ||
- 'Run unit tests only' | ||
pull_request: | ||
paths: | ||
- 'Syde/**' | ||
- 'tests/**' | ||
- '**ruleset.xml' | ||
- '.github/workflows/quality-assurance-php.yml' | ||
- 'composer.json' | ||
- 'phpcs.xml' | ||
- 'phpstan.neon.dist' | ||
- 'phpunit.xml.dist' | ||
workflow_dispatch: | ||
inputs: | ||
jobs: | ||
required: true | ||
type: choice | ||
default: 'Run all' | ||
description: 'Choose jobs to run' | ||
options: | ||
- 'Run all' | ||
- 'Run lint only' | ||
- 'Run PHPCS only' | ||
- 'Run PHPStan only' | ||
- 'Run static analysis' | ||
- 'Run unit tests only' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint-php: | ||
if: ${{ (github.event_name != 'workflow_dispatch') || ((github.event.inputs.jobs == 'Run all') || (github.event.inputs.jobs == 'Run lint only') || (github.event.inputs.jobs == 'Run static analysis')) }} | ||
uses: inpsyde/reusable-workflows/.github/workflows/lint-php.yml@main | ||
strategy: | ||
matrix: | ||
php-version: [ '8.1', '8.2', '8.3', '8.4' ] | ||
with: | ||
PHP_VERSION: ${{ matrix.php-version }} | ||
LINT_ARGS: '-e php --colors --show-deprecated ./Syde ./tests --exclude ./tests/fixtures/return-type-declaration.php' | ||
lint-php: | ||
if: ${{ (github.event_name != 'workflow_dispatch') || ((github.event.inputs.jobs == 'Run all') || (github.event.inputs.jobs == 'Run lint only') || (github.event.inputs.jobs == 'Run static analysis')) }} | ||
uses: inpsyde/reusable-workflows/.github/workflows/lint-php.yml@main | ||
strategy: | ||
matrix: | ||
php-version: [ '8.1', '8.2', '8.3', '8.4' ] | ||
with: | ||
PHP_VERSION: ${{ matrix.php-version }} | ||
LINT_ARGS: '-e php --colors --show-deprecated ./Syde ./tests --exclude ./tests/fixtures/return-type-declaration.php' | ||
|
||
coding-standards-analysis-php: | ||
if: ${{ (github.event_name != 'workflow_dispatch') || ((github.event.inputs.jobs == 'Run all') || (github.event.inputs.jobs == 'Run PHPCS only') || (github.event.inputs.jobs == 'Run static analysis')) }} | ||
uses: inpsyde/reusable-workflows/.github/workflows/coding-standards-php.yml@main | ||
strategy: | ||
matrix: | ||
php-version: [ '8.1', '8.2', '8.3', '8.4' ] | ||
with: | ||
PHP_VERSION: ${{ matrix.php-version }} | ||
coding-standards-analysis-php: | ||
if: ${{ (github.event_name != 'workflow_dispatch') || ((github.event.inputs.jobs == 'Run all') || (github.event.inputs.jobs == 'Run PHPCS only') || (github.event.inputs.jobs == 'Run static analysis')) }} | ||
uses: inpsyde/reusable-workflows/.github/workflows/coding-standards-php.yml@main | ||
strategy: | ||
matrix: | ||
php-version: [ '8.1', '8.2', '8.3', '8.4' ] | ||
with: | ||
PHP_VERSION: ${{ matrix.php-version }} | ||
|
||
static-code-analysis-php: | ||
if: ${{ (github.event_name != 'workflow_dispatch') || ((github.event.inputs.jobs == 'Run all') || (github.event.inputs.jobs == 'Run PHPStan only') || (github.event.inputs.jobs == 'Run static analysis')) }} | ||
# TODO: Replace with public Syde static-analysis-php reusable workflow as soon as PHPStan support is added. | ||
uses: ./.github/workflows/_phpstan.yml | ||
strategy: | ||
matrix: | ||
php-version: [ '8.1', '8.2', '8.3', '8.4' ] | ||
with: | ||
PHP_VERSION: ${{ matrix.php-version }} | ||
static-code-analysis-php: | ||
if: ${{ (github.event_name != 'workflow_dispatch') || ((github.event.inputs.jobs == 'Run all') || (github.event.inputs.jobs == 'Run PHPStan only') || (github.event.inputs.jobs == 'Run static analysis')) }} | ||
# TODO: Replace with public Syde static-analysis-php reusable workflow as soon as PHPStan support is added. | ||
uses: ./.github/workflows/_phpstan.yml | ||
strategy: | ||
matrix: | ||
php-version: [ '8.1', '8.2', '8.3', '8.4' ] | ||
with: | ||
PHP_VERSION: ${{ matrix.php-version }} | ||
|
||
tests-unit-php: | ||
if: ${{ (github.event_name != 'workflow_dispatch') || ((github.event.inputs.jobs == 'Run all') || (github.event.inputs.jobs == 'Run unit tests only')) }} | ||
uses: inpsyde/reusable-workflows/.github/workflows/tests-unit-php.yml@main | ||
strategy: | ||
matrix: | ||
php-version: [ '8.1', '8.2', '8.3', '8.4' ] | ||
with: | ||
PHP_VERSION: ${{ matrix.php-version }} | ||
PHPUNIT_ARGS: '--no-coverage' | ||
tests-unit-php: | ||
if: ${{ (github.event_name != 'workflow_dispatch') || ((github.event.inputs.jobs == 'Run all') || (github.event.inputs.jobs == 'Run unit tests only')) }} | ||
uses: inpsyde/reusable-workflows/.github/workflows/tests-unit-php.yml@main | ||
strategy: | ||
matrix: | ||
php-version: [ '8.1', '8.2', '8.3', '8.4' ] | ||
with: | ||
PHP_VERSION: ${{ matrix.php-version }} | ||
PHPUNIT_ARGS: '--no-coverage' |