Skip to content

Commit

Permalink
Sync workflow files with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire committed May 16, 2021
1 parent 7d280b8 commit 49184a2
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 13 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@

name: "Coding Standards"

on: ["pull_request", "push"]
on:
pull_request:
branches:
- "*.x"
push:
branches:
- "*.x"

jobs:
coding-standards:
Expand All @@ -26,6 +32,8 @@ jobs:

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "highest"

# https://github.com/doctrine/.github/issues/3
- name: "Run PHP_CodeSniffer"
Expand Down
55 changes: 47 additions & 8 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ on:
pull_request:
branches:
- "*.x"
- "master"
push:
branches:
- "*.x"
- "master"

env:
fail-fast: true

jobs:
phpunit:
Expand All @@ -23,29 +24,67 @@ jobs:
- "7.3"
- "7.4"
- "8.0"
deps:
dependencies:
- "highest"
include:
- deps: "lowest"
php-version: "7.2"
- php-version: "7.2"
dependencies: "lowest"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 2

- name: "Install PHP"
- name: "Install PHP with PCOV"
uses: "shivammathur/setup-php@v2"
if: "${{ matrix.php-version != '7.1' }}"
with:
php-version: "${{ matrix.php-version }}"
coverage: "pcov"
ini-values: "zend.assertions=1"

- name: "Install PHP with XDebug"
uses: "shivammathur/setup-php@v2"
if: "${{ matrix.php-version == '7.1' }}"
with:
php-version: "${{ matrix.php-version }}"
coverage: "xdebug"
ini-values: "zend.assertions=1"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "${{ matrix.deps }}"
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "--prefer-dist"

- name: "Run PHPUnit"
run: "vendor/bin/phpunit"
run: "vendor/bin/phpunit --coverage-clover=coverage.xml"

- name: "Upload coverage file"
uses: "actions/upload-artifact@v2"
with:
name: "phpunit-${{ matrix.php-version }}.coverage"
path: "coverage.xml"

upload_coverage:
name: "Upload coverage to Codecov"
runs-on: "ubuntu-20.04"
needs:
- "phpunit"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 2

- name: "Download coverage files"
uses: "actions/download-artifact@v2"
with:
path: "reports"

- name: "Upload to Codecov"
uses: "codecov/codecov-action@v1"
with:
directory: "reports"
8 changes: 4 additions & 4 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@

name: "Static Analysis"

on:
pull_request:
branches:
- "*.x"
- "master"
push:
branches:
- "*.x"
- "master"

jobs:
static-analysis-phpstan:
Expand All @@ -29,10 +28,11 @@ jobs:
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
tools: "cs2pr"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "highest"

- name: "Run a static analysis with phpstan/phpstan"
run: "vendor/bin/phpstan analyse -l 3 -c phpstan.neon --error-format=checkstyle lib/ tests/ | cs2pr"
run: "vendor/bin/phpstan analyse"
4 changes: 4 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
parameters:
level: 3
paths:
- lib
- tests
excludes_analyse:
- tests/*/Fixtures/*
- tests/Doctrine/Tests/Common/Annotations/ReservedKeywordsClasses.php
Expand Down

0 comments on commit 49184a2

Please sign in to comment.