Skip to content

Commit 545cf18

Browse files
authored
chore: split CIs and add concurrency (#1017)
1 parent 17796f2 commit 545cf18

File tree

7 files changed

+181
-91
lines changed

7 files changed

+181
-91
lines changed

.github/workflows/bc-check.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,12 @@ name: "Backward Compatibility Check"
22

33
on:
44
pull_request:
5-
branches:
6-
- "*.x"
7-
paths:
5+
paths: &paths
86
- .github/workflows/bc-check.yml
7+
- bin/tools/bc-check
98
- src/**
109
push:
11-
branches:
12-
- "*.x"
13-
paths:
14-
- .github/workflows/bc-check.yml
15-
- src/**
10+
paths: *paths
1611

1712
jobs:
1813
roave_bc_check:
@@ -37,4 +32,4 @@ jobs:
3732
run: composer bin bc-check require roave/backward-compatibility-check
3833

3934
- name: Run roave/backward-compatibility-check.
40-
run: bin/tools/bc-check/vendor/roave/backward-compatibility-check/bin/roave-backward-compatibility-check --install-development-dependencies
35+
run: bin/tools/bc-check/vendor/roave/backward-compatibility-check/bin/roave-backward-compatibility-check --install-development-dependencies --format=github-actions

.github/workflows/benchmarks.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1+
name: Benchmarks with PHPBench
2+
13
on:
24
workflow_dispatch:
35
pull_request:
4-
5-
name: "Benchmarks"
6+
paths:
7+
- .github/workflows/benchmarks.yml
8+
- bin/tools/phpbench
9+
- src/**
10+
- tests/Benchmark/**
11+
- composer.json
12+
- phpbench.json
613

714
jobs:
815
run:

.github/workflows/cs-fixer.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: PHP CS-Fixer
2+
3+
on:
4+
push:
5+
paths:
6+
- .github/workflows/cs-fixer.yml
7+
- src/**
8+
- tests/**
9+
- config/**
10+
- utils/**
11+
- .php-cs-fixer.dist.php
12+
13+
jobs:
14+
fixcs:
15+
name: Run php-cs-fixer
16+
needs: sync-with-template
17+
if: (github.event_name == 'push' || github.event_name == 'schedule') && !startsWith(github.ref, 'refs/tags') && github.repository_owner == 'zenstruck'
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: zenstruck/.github/actions/php-cs-fixer@main
21+
with:
22+
php: 8.1
23+
key: ${{ secrets.GPG_PRIVATE_KEY }}
24+
token: ${{ secrets.COMPOSER_TOKEN }}
25+
26+
sync-with-template:
27+
name: Sync meta files
28+
if: (github.event_name == 'push' || github.event_name == 'schedule') && !startsWith(github.ref, 'refs/tags') && github.repository_owner == 'zenstruck'
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: zenstruck/.github/actions/sync-with-template@main
32+
with:
33+
key: ${{ secrets.GPG_PRIVATE_KEY }}
34+
token: ${{ secrets.COMPOSER_TOKEN }}
35+
phpcsconfig: false

.github/workflows/lint-docs.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Lint docs
2+
3+
on:
4+
push:
5+
paths: &paths
6+
- .github/workflows/lint-docs.yml
7+
- docs/**
8+
pull_request:
9+
paths: *paths
10+
11+
jobs:
12+
lint-docs:
13+
name: Lint Documentation
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: "Checkout code"
17+
uses: actions/checkout@v3
18+
19+
- name: DOCtor-RST
20+
uses: docker://oskarstark/doctor-rst
21+
with:
22+
args: --short --error-format=github
23+
env:
24+
DOCS_DIR: 'docs/'

.github/workflows/ci.yml renamed to .github/workflows/phpunit.yml

Lines changed: 15 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
1-
name: CI
1+
name: PHPUnit
22

33
on:
44
push:
5+
paths: &paths
6+
- .github/workflows/phpunit.yml
7+
- config/**
8+
- skeleton/**
9+
- src/**
10+
- tests/**
11+
- composer.json
12+
- phpunit*
513
pull_request:
14+
paths: *paths
615
schedule:
716
- cron: '0 0 1,16 * *'
817

18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
20+
cancel-in-progress: true
21+
922
jobs:
1023
tests:
1124
name: P:${{ matrix.php }}, S:${{ matrix.symfony }}, D:${{ matrix.database }}, PU:${{ matrix.phpunit }}${{ matrix.deps == 'lowest' && ' (lowest)' || '' }}${{ matrix.use-phpunit-extension == 1 && ' (phpunit extension)' || '' }}${{ (matrix.use-php-84-lazy-objects != 1 || matrix.php != '8.4') && ' (legacy proxy)' || '' }}
@@ -221,6 +234,7 @@ jobs:
221234
run: |
222235
vendor/bin/phpunit tests/Unit
223236
237+
224238
test-with-paratest:
225239
name: Test with paratest
226240
runs-on: ubuntu-latest
@@ -313,78 +327,3 @@ jobs:
313327
with:
314328
file: ./coverage.xml
315329

316-
composer-validate:
317-
uses: zenstruck/.github/.github/workflows/php-composer-validate.yml@main
318-
319-
lint-docs:
320-
name: Lint Documentation
321-
runs-on: ubuntu-latest
322-
steps:
323-
- name: "Checkout code"
324-
uses: actions/checkout@v3
325-
326-
- name: DOCtor-RST
327-
uses: docker://oskarstark/doctor-rst
328-
with:
329-
args: --short --error-format=github
330-
env:
331-
DOCS_DIR: 'docs/'
332-
333-
static-analysis:
334-
name: Static Analysis
335-
runs-on: ubuntu-latest
336-
steps:
337-
- name: Checkout code
338-
uses: actions/checkout@v3
339-
340-
- name: Setup PHP
341-
uses: shivammathur/setup-php@v2
342-
with:
343-
php-version: 8.4
344-
coverage: none
345-
346-
- name: Install dependencies
347-
uses: ramsey/composer-install@v2
348-
with:
349-
composer-options: --prefer-dist
350-
351-
- name: Validate PSR-4
352-
run: composer dump-autoload --optimize --strict-psr --strict-ambiguous
353-
354-
- name: Install PHPStan
355-
run: composer bin phpstan install
356-
357-
- name: Install PHPBench
358-
run: composer bin phpbench install
359-
360-
- name: Run static analysis
361-
run: bin/tools/phpstan/vendor/phpstan/phpstan/phpstan analyse
362-
363-
- name: Install Psalm
364-
run: composer bin psalm install
365-
366-
- name: Run Psalm on factories generated with maker
367-
run: bin/tools/psalm/vendor/vimeo/psalm/psalm
368-
369-
fixcs:
370-
name: Run php-cs-fixer
371-
needs: sync-with-template
372-
if: (github.event_name == 'push' || github.event_name == 'schedule') && !startsWith(github.ref, 'refs/tags') && github.repository_owner == 'zenstruck'
373-
runs-on: ubuntu-latest
374-
steps:
375-
- uses: zenstruck/.github/actions/php-cs-fixer@main
376-
with:
377-
php: 8.1
378-
key: ${{ secrets.GPG_PRIVATE_KEY }}
379-
token: ${{ secrets.COMPOSER_TOKEN }}
380-
381-
sync-with-template:
382-
name: Sync meta files
383-
if: (github.event_name == 'push' || github.event_name == 'schedule') && !startsWith(github.ref, 'refs/tags') && github.repository_owner == 'zenstruck'
384-
runs-on: ubuntu-latest
385-
steps:
386-
- uses: zenstruck/.github/actions/sync-with-template@main
387-
with:
388-
key: ${{ secrets.GPG_PRIVATE_KEY }}
389-
token: ${{ secrets.COMPOSER_TOKEN }}
390-
phpcsconfig: false
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Static analysis
2+
3+
on:
4+
push:
5+
paths: &paths
6+
- .github/workflows/static-analysis.yml
7+
- bin/tools/phpstan
8+
- bin/tools/psalm
9+
- config/**
10+
- stubs/**
11+
- src/**
12+
- tests/**
13+
- composer.json
14+
- phpstan.neon
15+
- psalm.xml
16+
pull_request:
17+
paths: *paths
18+
schedule:
19+
- cron: '0 0 1,16 * *'
20+
21+
jobs:
22+
phpstan:
23+
name: PhpStan
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v3
28+
29+
- name: Setup PHP
30+
uses: shivammathur/setup-php@v2
31+
with:
32+
php-version: 8.4
33+
coverage: none
34+
35+
- name: Install dependencies
36+
uses: ramsey/composer-install@v2
37+
with:
38+
composer-options: --prefer-dist
39+
40+
- name: Install PHPStan
41+
run: composer bin phpstan install
42+
43+
- name: Install PHPBench
44+
run: composer bin phpbench install
45+
46+
- name: Run PHPStan
47+
run: bin/tools/phpstan/vendor/phpstan/phpstan/phpstan analyse
48+
49+
psalm:
50+
name: Psalm on factories generated with maker
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Checkout code
54+
uses: actions/checkout@v3
55+
56+
- name: Setup PHP
57+
uses: shivammathur/setup-php@v2
58+
with:
59+
php-version: 8.4
60+
coverage: none
61+
62+
- name: Install dependencies
63+
uses: ramsey/composer-install@v2
64+
with:
65+
composer-options: --prefer-dist
66+
67+
- name: Install Psalm
68+
run: composer bin psalm install
69+
70+
- name: Run Psalm
71+
run: bin/tools/psalm/vendor/vimeo/psalm/psalm
72+
73+
composer-validate:
74+
uses: zenstruck/.github/.github/workflows/php-composer-validate.yml@main
75+
76+
composer-validate-psr:
77+
name: PhpStan
78+
runs-on: ubuntu-latest
79+
steps:
80+
- name: Checkout code
81+
uses: actions/checkout@v3
82+
83+
- name: Setup PHP
84+
uses: shivammathur/setup-php@v2
85+
with:
86+
php-version: 8.4
87+
coverage: none
88+
89+
- name: Validate PSR-4
90+
run: composer dump-autoload --optimize --strict-psr --strict-ambiguous

.github/workflows/test-rector-rules.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: Rector Rules Test
22

33
on:
44
push:
5-
paths:
6-
- 'utils/rector/**'
5+
paths: &paths
6+
- .github/workflows/test-rector-rules.yml
7+
- utils/rector/**
78
pull_request:
8-
paths:
9-
- 'utils/rector/**'
9+
paths: *paths
1010
schedule:
1111
- cron: '0 0 1,16 * *'
1212

0 commit comments

Comments
 (0)