Skip to content

Commit 7d29ceb

Browse files
authored
Merge pull request #450 from greg0ire/reuse-workflows
Reuse workflows from upstream
2 parents 0a081b5 + 739d439 commit 7d29ceb

File tree

9 files changed

+51
-180
lines changed

9 files changed

+51
-180
lines changed

.github/workflows/coding-standards.yml

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,4 @@ on:
1212
jobs:
1313
coding-standards:
1414
name: "Coding Standards"
15-
runs-on: "ubuntu-20.04"
16-
17-
strategy:
18-
matrix:
19-
php-version:
20-
- "7.4"
21-
22-
steps:
23-
- name: "Checkout"
24-
uses: "actions/checkout@v2"
25-
26-
- name: "Install PHP"
27-
uses: "shivammathur/setup-php@v2"
28-
with:
29-
coverage: "none"
30-
php-version: "${{ matrix.php-version }}"
31-
tools: "cs2pr"
32-
33-
- name: "Install dependencies with Composer"
34-
uses: "ramsey/composer-install@v1"
35-
with:
36-
dependency-versions: "highest"
37-
38-
# https://github.com/doctrine/.github/issues/3
39-
- name: "Run PHP_CodeSniffer"
40-
run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr"
15+
uses: "doctrine/.github/.github/workflows/[email protected]"

.github/workflows/continuous-integration.yml

Lines changed: 3 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -9,90 +9,9 @@ on:
99
branches:
1010
- "*.x"
1111

12-
env:
13-
fail-fast: true
14-
1512
jobs:
1613
phpunit:
1714
name: "PHPUnit"
18-
runs-on: "ubuntu-20.04"
19-
20-
strategy:
21-
matrix:
22-
php-version:
23-
- "7.1"
24-
- "7.2"
25-
- "7.3"
26-
- "7.4"
27-
dependencies:
28-
- "highest"
29-
stability:
30-
- "stable"
31-
include:
32-
- dependencies: "lowest"
33-
php-version: "7.1"
34-
- stability: "dev"
35-
php-version: "8.0"
36-
37-
steps:
38-
- name: "Checkout"
39-
uses: "actions/checkout@v2"
40-
with:
41-
fetch-depth: 2
42-
43-
- name: "Install PHP with PCOV"
44-
uses: "shivammathur/setup-php@v2"
45-
if: "${{ matrix.php-version != '7.1' }}"
46-
with:
47-
php-version: "${{ matrix.php-version }}"
48-
coverage: "pcov"
49-
ini-values: "zend.assertions=1"
50-
51-
- name: "Install PHP with XDebug"
52-
uses: "shivammathur/setup-php@v2"
53-
if: "${{ matrix.php-version == '7.1' }}"
54-
with:
55-
php-version: "${{ matrix.php-version }}"
56-
coverage: "xdebug"
57-
ini-values: "zend.assertions=1"
58-
59-
- name: "Allow installing dev dependencies"
60-
run: "composer config minimum-stability dev"
61-
if: "${{ matrix.stability == 'dev' }}"
62-
63-
- name: "Install dependencies with Composer"
64-
uses: "ramsey/composer-install@v1"
65-
with:
66-
dependency-versions: "${{ matrix.dependencies }}"
67-
composer-options: "--prefer-dist"
68-
69-
- name: "Run PHPUnit"
70-
run: "vendor/bin/phpunit --coverage-clover=coverage.xml"
71-
72-
- name: "Upload coverage file"
73-
uses: "actions/upload-artifact@v2"
74-
with:
75-
name: "phpunit-${{ matrix.deps }}-${{ matrix.php-version }}.coverage"
76-
path: "coverage.xml"
77-
78-
upload_coverage:
79-
name: "Upload coverage to Codecov"
80-
runs-on: "ubuntu-20.04"
81-
needs:
82-
- "phpunit"
83-
84-
steps:
85-
- name: "Checkout"
86-
uses: "actions/checkout@v2"
87-
with:
88-
fetch-depth: 2
89-
90-
- name: "Download coverage files"
91-
uses: "actions/download-artifact@v2"
92-
with:
93-
path: "reports"
94-
95-
- name: "Upload to Codecov"
96-
uses: "codecov/codecov-action@v1"
97-
with:
98-
directory: reports
15+
uses: "doctrine/.github/.github/workflows/[email protected]"
16+
with:
17+
php-versions: '["7.1", "7.2", "7.3", "7.4", "8.0"]'

.github/workflows/release-on-milestone-closed.yml

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,10 @@ on:
88
jobs:
99
release:
1010
name: "Git tag, release & create merge-up PR"
11-
runs-on: "ubuntu-20.04"
12-
13-
steps:
14-
- name: "Checkout"
15-
uses: "actions/checkout@v2"
16-
17-
- name: "Release"
18-
uses: "laminas/automatic-releases@v1"
19-
with:
20-
command-name: "laminas:automatic-releases:release"
21-
env:
22-
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
23-
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
24-
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
25-
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
26-
27-
- name: "Create Merge-Up Pull Request"
28-
uses: "laminas/automatic-releases@v1"
29-
with:
30-
command-name: "laminas:automatic-releases:create-merge-up-pull-request"
31-
env:
32-
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
33-
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
34-
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
35-
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
36-
37-
- name: "Create new milestones"
38-
uses: "laminas/automatic-releases@v1"
39-
with:
40-
command-name: "laminas:automatic-releases:create-milestones"
41-
env:
42-
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
43-
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
44-
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
45-
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
11+
uses: "doctrine/.github/.github/workflows/[email protected]"
12+
secrets:
13+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
15+
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
16+
ORGANIZATION_ADMIN_TOKEN: ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
17+
SIGNING_SECRET_KEY: ${{ secrets.SIGNING_SECRET_KEY }}

.github/workflows/static-analysis.yml

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,6 @@ on:
1010
- "*.x"
1111

1212
jobs:
13-
static-analysis-phpstan:
14-
name: "Static Analysis with PHPStan"
15-
runs-on: "ubuntu-20.04"
16-
17-
strategy:
18-
matrix:
19-
php-version:
20-
- "7.4"
21-
22-
steps:
23-
- name: "Checkout code"
24-
uses: "actions/checkout@v2"
25-
26-
- name: "Install PHP"
27-
uses: "shivammathur/setup-php@v2"
28-
with:
29-
coverage: "none"
30-
php-version: "${{ matrix.php-version }}"
31-
tools: "cs2pr"
32-
33-
- name: "Install dependencies with Composer"
34-
uses: "ramsey/composer-install@v1"
35-
with:
36-
dependency-versions: "highest"
37-
38-
- name: "Run a static analysis with phpstan/phpstan"
39-
run: "vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr"
13+
static-analysis:
14+
name: "Static Analysis"
15+
uses: "doctrine/.github/.github/workflows/[email protected]"

DependencyInjection/DoctrineMigrationsExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class DoctrineMigrationsExtension extends Extension
2323
*
2424
* @param mixed[][] $configs
2525
*
26-
* @psalm-param array<string, array<string, array<string, string>|string>>> $configs
26+
* @psalm-param array<string, array<string, array<string, array<string, string>|string>|string>> $configs
2727
*/
2828
public function load(array $configs, ContainerBuilder $container): void
2929
{

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"mikey179/vfsstream": "^1.6",
3131
"doctrine/coding-standard": "^8.0",
3232
"phpstan/phpstan": "^0.12",
33-
"phpstan/phpstan-strict-rules": "^0.12"
33+
"phpstan/phpstan-strict-rules": "^0.12",
34+
"vimeo/psalm": "^4.11"
3435
},
3536
"autoload": {
3637
"psr-4": { "Doctrine\\Bundle\\MigrationsBundle\\": "" },

phpstan.neon

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
parameters:
22
level: 7
33
paths:
4-
- %currentWorkingDirectory%/Command
5-
- %currentWorkingDirectory%/Tests
6-
ignoreErrors:
7-
# This is due to a bug in DoctrineBundle
8-
- '~Parameter \#2 \$connName of static method Doctrine\\Bundle\\DoctrineBundle\\Command\\Proxy\\DoctrineCommandHelper::setApplicationConnection\(\) expects string, array\<string\>\|bool\|string\|null given\.~'
9-
- '~Parameter \#2 \$emName of static method Doctrine\\Bundle\\DoctrineBundle\\Command\\Proxy\\DoctrineCommandHelper::setApplicationEntityManager\(\) expects string, array\<string\>\|bool\|string\|null given\.~'
4+
- Command
5+
- Tests
106
includes:
117
- vendor/phpstan/phpstan-strict-rules/rules.neon

psalm-baseline.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<files psalm-version="4.11.2@6fba5eb554f9507b72932f9c75533d8af593688d">
3+
<file src="DependencyInjection/Configuration.php">
4+
<UndefinedMethod occurrences="1">
5+
<code>root</code>
6+
</UndefinedMethod>
7+
</file>
8+
<file src="DependencyInjection/DoctrineMigrationsExtension.php">
9+
<MoreSpecificImplementedParamType occurrences="1">
10+
<code>$configs</code>
11+
</MoreSpecificImplementedParamType>
12+
</file>
13+
</files>

psalm.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
errorLevel="4"
4+
resolveFromConfigFile="true"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xmlns="https://getpsalm.org/schema/config"
7+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
8+
errorBaseline="psalm-baseline.xml"
9+
>
10+
<projectFiles>
11+
<directory name="Command" />
12+
<directory name="DependencyInjection" />
13+
<directory name="Tests" />
14+
<file name="DoctrineMigrationsBundle.php" />
15+
<ignoreFiles>
16+
<directory name="vendor" />
17+
</ignoreFiles>
18+
</projectFiles>
19+
</psalm>

0 commit comments

Comments
 (0)