-
Notifications
You must be signed in to change notification settings - Fork 530
Enhancement: Run lint target using GitHub Actions #128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ondrejmirtes
merged 21 commits into
phpstan:master
from
localheinz:feature/github-actions
Feb 6, 2020
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
5dd592f
Fix phpstan-static-php-parser on PHP 7.4
ondrejmirtes 10d285f
Enhancement: Run lint target using GitHub Actions
localheinz b086c3a
Rename action name
ondrejmirtes 4b7b5ce
Rename steps
ondrejmirtes 0cd2cba
Run Phing targets separately
ondrejmirtes 8777cb8
Fix: Move workflow definition into appropriate directory
localheinz 5aa888b
Fix: Expand build matrix
localheinz 85cf998
Fix: Run jobs in parallel instead of job with multiple steps
localheinz b286210
Enhancement: Use shivammathur/setup-php to install PHP
localheinz 1db51ba
Fix: Rename workflow definition file
localheinz a71b6f0
Run PHPCS only on PHP 7.4
ondrejmirtes 97e7554
Use ComposerRequireChecker 2.1.0 that supports PHP 7.4
ondrejmirtes bebc469
Run static-analysis-with-static-php-parser on all PHP versions
ondrejmirtes 6ea30af
Non-strict Composer validate
ondrejmirtes 4636e47
Title Case is nicer
ondrejmirtes 728e583
PHPCS will run only if Lint is successful, no need to && them together
ondrejmirtes dd91823
Enhancement: Run builds for pushes to any branch
localheinz a076bab
Fix: Run builds for pushes to master only
localheinz 8367aa7
Try advice for Composer issue
ondrejmirtes d0f0197
Clean up what Travis CI does
ondrejmirtes 10d041a
Enhancement: Configure COMPOSER_ROOT_VERSION environment variable for…
localheinz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,196 @@ | ||
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions | ||
|
||
name: "Build" | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- "master" | ||
|
||
env: | ||
COMPOSER_ROOT_VERSION: "0.12.x-dev" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like this could be a potential workaround, @ondrejmirtes - I have moved it to the workflow level (so we don't have to repeat it). It's currently not possible to use anchors - see https://github.community/t5/GitHub-Actions/Support-for-YAML-anchors/m-p/30336. |
||
|
||
jobs: | ||
coding-standards: | ||
name: "Coding Standard" | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
strategy: | ||
matrix: | ||
php-version: | ||
- "7.4" | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v2.0.0" | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@1.8.2" | ||
with: | ||
coverage: "none" | ||
php-version: "${{ matrix.php-version }}" | ||
|
||
- name: "Validate Composer" | ||
run: "composer validate" | ||
|
||
- name: "Cache dependencies" | ||
uses: "actions/cache@v1.0.3" | ||
with: | ||
path: "~/.composer/cache" | ||
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}" | ||
restore-keys: "php-${{ matrix.php-version }}-composer-" | ||
|
||
- name: "Install dependencies" | ||
run: "composer update --no-interaction --no-progress --no-suggest" | ||
|
||
- name: "Composer Normalize" | ||
run: "vendor/bin/phing composer-normalize-check" | ||
|
||
- name: "Lint" | ||
run: "vendor/bin/phing lint" | ||
|
||
- name: "Coding Standard" | ||
run: "vendor/bin/phing cs" | ||
|
||
dependency-analysis: | ||
name: "Dependency Analysis" | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
strategy: | ||
matrix: | ||
php-version: | ||
- "7.4" | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v2.0.0" | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@1.8.2" | ||
with: | ||
coverage: "none" | ||
php-version: "${{ matrix.php-version }}" | ||
|
||
- name: "Cache dependencies" | ||
uses: "actions/cache@v1.0.3" | ||
with: | ||
path: "~/.composer/cache" | ||
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}" | ||
restore-keys: "php-${{ matrix.php-version }}-composer-" | ||
|
||
- name: "Install dependencies" | ||
run: "composer update --no-interaction --no-progress --no-suggest" | ||
|
||
- name: "Composer Require Checker" | ||
run: "vendor/bin/phing composer-require-checker" | ||
|
||
tests: | ||
name: "Tests" | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
strategy: | ||
matrix: | ||
php-version: | ||
- "7.1" | ||
- "7.2" | ||
- "7.3" | ||
- "7.4" | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v2.0.0" | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@1.8.2" | ||
with: | ||
coverage: "none" | ||
php-version: "${{ matrix.php-version }}" | ||
|
||
- name: "Cache dependencies" | ||
uses: "actions/cache@v1.0.3" | ||
with: | ||
path: "~/.composer/cache" | ||
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}" | ||
restore-keys: "php-${{ matrix.php-version }}-composer-" | ||
|
||
- name: "Install dependencies" | ||
run: "composer update --no-interaction --no-progress --no-suggest" | ||
|
||
- name: "Tests" | ||
run: "vendor/bin/phing tests" | ||
|
||
static-analysis: | ||
name: "PHPStan" | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
strategy: | ||
matrix: | ||
php-version: | ||
- "7.1" | ||
- "7.2" | ||
- "7.3" | ||
- "7.4" | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v2.0.0" | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@1.8.2" | ||
with: | ||
coverage: "none" | ||
php-version: "${{ matrix.php-version }}" | ||
|
||
- name: "Cache dependencies" | ||
uses: "actions/cache@v1.0.3" | ||
with: | ||
path: "~/.composer/cache" | ||
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}" | ||
restore-keys: "php-${{ matrix.php-version }}-composer-" | ||
|
||
- name: "Install dependencies" | ||
run: "composer update --no-interaction --no-progress --no-suggest" | ||
|
||
- name: "PHPStan" | ||
run: "vendor/bin/phing phpstan" | ||
|
||
static-analysis-with-static-php-parser: | ||
name: "PHPStan with static PHP parser" | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
strategy: | ||
matrix: | ||
php-version: | ||
- "7.1" | ||
- "7.2" | ||
- "7.3" | ||
- "7.4" | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v2.0.0" | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@1.8.2" | ||
with: | ||
coverage: "none" | ||
php-version: "${{ matrix.php-version }}" | ||
|
||
- name: "Cache dependencies" | ||
uses: "actions/cache@v1.0.3" | ||
with: | ||
path: "~/.composer/cache" | ||
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}" | ||
restore-keys: "php-${{ matrix.php-version }}-composer-" | ||
|
||
- name: "Install dependencies" | ||
run: "composer update --no-interaction --no-progress --no-suggest" | ||
|
||
- name: "PHPStan with static PHP-Parser" | ||
run: "vendor/bin/phing phpstan-static-php-parser" |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name used here does not need to match the name of the workflow definition file.
However, I think it makes sense when they have at least a similar name.