Skip to content

Commit fa58331

Browse files
committed
ci: add npm caching & concurrency
1 parent 2e0c168 commit fa58331

10 files changed

Lines changed: 50 additions & 11 deletions

File tree

.claude/settings.local.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

.github/actions/acceptance/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ inputs:
1616
runs:
1717
using: composite
1818
steps:
19+
- name: Cache npm
20+
uses: actions/cache@v4
21+
with:
22+
path: ~/.npm
23+
key: ${{ runner.os }}-acceptance-${{ hashFiles('tests/acceptance/package-lock.json') }}
24+
1925
- name: Setup extension
2026
uses: shopware/github-actions/setup-extension@main
2127
with:

.github/actions/jest/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ inputs:
99
runs:
1010
using: composite
1111
steps:
12+
- name: Cache npm
13+
uses: actions/cache@v4
14+
with:
15+
path: ~/.npm
16+
key: ${{ runner.os }}-admin-${{ hashFiles('src/Resources/app/administration/package-lock.json', 'tests/Jest/package-lock.json', 'tests/acceptance/package-lock.json') }}
17+
1218
- name: Setup extension
1319
uses: shopware/github-actions/setup-extension@main
1420
with:
@@ -24,6 +30,7 @@ runs:
2430
"symlink": true
2531
}
2632
}
33+
2734
- name: Run Jest
2835
shell: bash
2936
run: |

.github/actions/phpstan/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,25 @@ runs:
2626
"symlink": true
2727
}
2828
}
29+
2930
- name: Create phpstan.neon
3031
working-directory: custom/plugins/${{ inputs.extension_name }}
3132
shell: bash
3233
run: |
3334
printf "parameters:\n tmpDir: ${GITHUB_WORKSPACE}/var/phpstan\nincludes:\n - phpstan.neon.dist" > phpstan.neon
35+
3436
- name: PHPStan cache
3537
uses: actions/cache@v4
3638
with:
3739
path: ${{ github.workspace }}/var/phpstan
3840
key: ${{ runner.os }}-${{ github.repository }}-phpstan-${{ github.sha }}
3941
restore-keys: |
4042
${{ runner.os }}-${{ github.repository }}-phpstan-
43+
4144
- name: Build PHPStan Bootstrap
4245
shell: bash
4346
run: php ${GITHUB_WORKSPACE}/src/Core/DevOps/StaticAnalyze/phpstan-bootstrap.php
47+
4448
- name: Run PHPStan
4549
shell: bash
4650
run: |

.github/actions/phpunit/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ runs:
2626
"symlink": true
2727
}
2828
}
29+
2930
- name: Import SW5 TestData DB
3031
working-directory: custom/plugins/${{ inputs.extension_name }}/tests
3132
shell: bash
3233
run: mysql -uroot < _fixtures/database/shopware55.sql
34+
3335
- name: Run PHPUnit
3436
working-directory: custom/plugins/${{ inputs.extension_name }}
3537
shell: bash

.github/workflows/acceptance.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ on:
1717
- trunk
1818
pull_request:
1919

20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
22+
cancel-in-progress: true
23+
2024
jobs:
2125
playwright:
2226
name: Playwright
@@ -34,6 +38,7 @@ jobs:
3438
steps:
3539
- name: Checkout repository
3640
uses: actions/checkout@v5
41+
3742
- name: Run Playwright
3843
uses: ./.github/actions/acceptance
3944
with:

.github/workflows/admin.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ on:
1313
- src/Resources/app/administration/**
1414
- tests/Jest/**
1515
- .github/actions/**
16-
- .github/workflows/*.yml
16+
- .github/workflows/**
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
20+
cancel-in-progress: true
1721

1822
jobs:
1923
lint:
@@ -35,6 +39,7 @@ jobs:
3539
"symlink": true
3640
}
3741
}
42+
3843
- name: Run lint and formatting checks
3944
run: |
4045
composer -d custom/plugins/${{ env.EXTENSION_NAME }} run admin:install
@@ -61,6 +66,7 @@ jobs:
6166
"symlink": true
6267
}
6368
}
69+
6470
- name: Run stylelint
6571
run: |
6672
composer -d custom/plugins/${{ env.EXTENSION_NAME }} run admin:install
@@ -74,6 +80,7 @@ jobs:
7480
steps:
7581
- name: Checkout repository
7682
uses: actions/checkout@v5
83+
7784
- name: Run Jest
7885
uses: ./.github/actions/jest
7986
with:

.github/workflows/integration.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
- trunk
1212
pull_request:
1313

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
16+
cancel-in-progress: true
17+
1418
jobs:
1519
danger:
1620
name: Danger Check
@@ -19,6 +23,7 @@ jobs:
1923
steps:
2024
- name: Checkout repository
2125
uses: actions/checkout@v4
26+
2227
- name: Run Danger PHP
2328
uses: docker://ghcr.io/shyim/danger-php:latest
2429
with:
@@ -43,6 +48,7 @@ jobs:
4348
steps:
4449
- name: Checkout repository
4550
uses: actions/checkout@v5
51+
4652
- name: Run PHPUnit
4753
uses: ./.github/actions/phpunit
4854
with:
@@ -68,5 +74,6 @@ jobs:
6874
"symlink": true
6975
}
7076
}
77+
7178
- name: Uninstall Plugin
7279
run: php bin/console plugin:uninstall ${{ env.EXTENSION_NAME }}

.github/workflows/nightly.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ env:
66

77
on:
88
schedule:
9-
- cron: '0 3 * * *'
9+
- cron: '0 1 * * *'
1010
workflow_dispatch:
1111

1212
concurrency:
@@ -20,6 +20,7 @@ jobs:
2020
steps:
2121
- name: Checkout repository
2222
uses: actions/checkout@v5
23+
2324
- name: Run PHPStan
2425
uses: ./.github/actions/phpstan
2526
with:
@@ -31,6 +32,7 @@ jobs:
3132
steps:
3233
- name: Checkout repository
3334
uses: actions/checkout@v5
35+
3436
- name: Run PHPUnit
3537
uses: ./.github/actions/phpunit
3638
with:
@@ -45,6 +47,7 @@ jobs:
4547
steps:
4648
- name: Checkout repository
4749
uses: actions/checkout@v5
50+
4851
- name: Run Jest
4952
uses: ./.github/actions/jest
5053
with:
@@ -66,6 +69,7 @@ jobs:
6669
steps:
6770
- name: Checkout repository
6871
uses: actions/checkout@v5
72+
6973
- name: Run Playwright
7074
uses: ./.github/actions/acceptance
7175
with:

.github/workflows/php.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ on:
1414
- src/**/*.php
1515
- tests/**/*.php
1616
- .github/actions/**
17-
- .github/workflows/*.yml
17+
- .github/workflows/**
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
21+
cancel-in-progress: true
1822

1923
jobs:
2024
codestyle_php:
@@ -31,6 +35,7 @@ jobs:
3135
steps:
3236
- name: Checkout repository
3337
uses: actions/checkout@v5
38+
3439
- name: Run PHPStan
3540
uses: ./.github/actions/phpstan
3641
with:

0 commit comments

Comments
 (0)