Skip to content

Commit dc49c80

Browse files
ci: optimize CI workflow performance
1 parent 118bfa3 commit dc49c80

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
branches:
1111
- main
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
16+
1317
permissions:
1418
contents: read
1519

.github/workflows/integration-tests.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
branches:
1111
- main
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
16+
1317
permissions:
1418
contents: read
1519

@@ -81,7 +85,7 @@ jobs:
8185
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2
8286
with:
8387
php-version: ${{ matrix.php }}
84-
coverage: xdebug
88+
coverage: ${{ matrix.calculate-code-coverage && 'xdebug' || 'none' }}
8589
extensions: ctype, json, mbstring, pdo_pgsql
8690
tools: composer
8791

@@ -93,9 +97,10 @@ jobs:
9397
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
9498
with:
9599
path: vendor
96-
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
100+
key: ${{ runner.os }}-php-${{ matrix.php }}-pg-${{ matrix.postgres }}-${{ hashFiles('**/composer.lock') }}
97101
restore-keys: |
98-
${{ runner.os }}-php-
102+
${{ runner.os }}-php-${{ matrix.php }}-pg-${{ matrix.postgres }}-
103+
${{ runner.os }}-php-${{ matrix.php }}-
99104
100105
- name: Install dependencies
101106
run: composer install --prefer-dist --no-interaction --no-progress

.github/workflows/unit-tests.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
branches:
1111
- main
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
16+
1317
permissions:
1418
contents: read
1519

@@ -63,7 +67,7 @@ jobs:
6367
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2
6468
with:
6569
php-version: ${{ matrix.php }}
66-
coverage: xdebug
70+
coverage: ${{ matrix.calculate-code-coverage && 'xdebug' || 'none' }}
6771
extensions: ctype, json, mbstring
6872
tools: composer
6973

@@ -72,9 +76,10 @@ jobs:
7276
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
7377
with:
7478
path: vendor
75-
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
79+
key: ${{ runner.os }}-php-${{ matrix.php }}-orm-${{ matrix.doctrine-orm }}-lexer-${{ matrix.doctrine-lexer }}-${{ hashFiles('**/composer.lock') }}
7680
restore-keys: |
77-
${{ runner.os }}-php-
81+
${{ runner.os }}-php-${{ matrix.php }}-orm-${{ matrix.doctrine-orm }}-lexer-${{ matrix.doctrine-lexer }}-
82+
${{ runner.os }}-php-${{ matrix.php }}-
7883
7984
- name: Install Doctrine Lexer dependency
8085
run: |

0 commit comments

Comments
 (0)