Skip to content

Commit f2f436e

Browse files
committed
Merge remote-tracking branch 'upstream/2.x' into 2.x
# Conflicts: # src/Autocomplete/assets/dist/controller.js
2 parents 16e6655 + 269016e commit f2f436e

File tree

1,227 files changed

+40746
-32676
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,227 files changed

+40746
-32676
lines changed

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,9 @@ trim_trailing_whitespace = true
1111
[*.{php,html,twig}]
1212
indent_style = space
1313
indent_size = 4
14+
15+
[*.md]
16+
max_line_length = 80
17+
18+
[COMMIT_EDITMSG]
19+
max_line_length = 0

.gitattributes

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
11
* text=auto eol=lf
2-
/.yarn/** linguist-vendored
3-
/.yarn/releases/* binary
4-
/.yarn/plugins/**/* binary
5-
/.pnp.* binary linguist-generated

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
| Q | A
2-
| ------------- | ---
3-
| Bug fix? | yes/no
4-
| New feature? | yes/no <!-- please update src/**/CHANGELOG.md files -->
5-
| Docs? | yes/no <!-- required for new features -->
6-
| Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
7-
| License | MIT
1+
| Q | A
2+
| -------------- | ---
3+
| Bug fix? | yes/no
4+
| New feature? | yes/no <!-- please update src/**/CHANGELOG.md files -->
5+
| Deprecations? | yes/no <!-- if yes, also update UPGRADE-*.md and src/**/CHANGELOG.md -->
6+
| Documentation? | yes/no <!-- required for new features, or documentation updates -->
7+
| Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
8+
| License | MIT
89

910
<!--
1011
Replace this notice by a description of your feature/bugfix.

.github/build-packages.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Symfony\Component\Finder\Finder;
1010

1111
$finder = (new Finder())
12-
->in([__DIR__.'/../src/*/', __DIR__.'/../src/*/src/Bridge/*/', __DIR__.'/../ux.symfony.com/', __DIR__.'/../test_apps/*/'])
12+
->in([__DIR__.'/../src/*/', __DIR__.'/../src/*/src/Bridge/*/', __DIR__.'/../ux.symfony.com/', __DIR__.'/../apps/*/'])
1313
->depth(0)
1414
->name('composer.json')
1515
;

.github/workflows/.utils.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
_run_task() {
1+
# Create a non-exiting version of _run_task for sequential execution
2+
# This is used to run the tests sequentially on Windows
3+
# because parallel is not available on Windows.
4+
_run_task_sequential() {
25
local ok=0
36
local title="$1"
47
local start=$(date -u +%s)
@@ -16,7 +19,13 @@ _run_task() {
1619
echo -e "\n\\e[32mOK\\e[0m $title\\n\\n::endgroup::"
1720
fi
1821

19-
exit $ok
22+
return $ok
23+
}
24+
export -f _run_task_sequential
25+
26+
_run_task() {
27+
_run_task_sequential "$1" "$2"
28+
exit $?
2029
}
2130
export -f _run_task
2231

.github/workflows/app-tests.yaml

Lines changed: 34 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -35,69 +35,64 @@ jobs:
3535

3636
- uses: actions/setup-node@v4
3737
with:
38-
cache: 'yarn'
39-
cache-dependency-path: |
40-
yarn.lock
41-
package.json
42-
src/**/package.json
43-
test_apps/encore-app/package.json
38+
node-version-file: '.nvmrc'
4439

4540
- uses: shivammathur/setup-php@v2
4641

4742
- name: Install root dependencies
48-
run: composer install
43+
uses: ramsey/composer-install@v3
44+
with:
45+
working-directory: ${{ github.workspace }}
4946

5047
- name: Build root packages
5148
run: php .github/build-packages.php
5249

53-
# We always install PHP deps because we of the UX Translator, which requires `var/translations` to exists
54-
- name: Install App dependenies
55-
run: composer update
56-
working-directory: test_apps/encore-app
50+
# We always install PHP deps because of the UX Translator, which requires `var/translations` to exists
51+
- name: Install PHP dependencies
52+
uses: ramsey/composer-install@v3
53+
with:
54+
working-directory: apps/encore
55+
dependency-versions: highest
5756

58-
- if: matrix.ux-packages-source == 'php-vendor'
59-
name: Refresh dependencies from vendor/
60-
working-directory: test_apps/encore-app
61-
run: yarn
62-
env:
63-
YARN_ENABLE_HARDENED_MODE: 0
64-
YARN_ENABLE_IMMUTABLE_INSTALLS: 0
57+
- working-directory: apps/encore
58+
run: npm install --install-links
6559

6660
- if: matrix.ux-packages-source == 'js-packages'
6761
name: Install UX JS packages with a JS package manager
68-
working-directory: test_apps/encore-app
62+
working-directory: apps/encore
6963
run: |
7064
PACKAGES_TO_INSTALL=''
71-
for PACKAGE in $(cd ../..; yarn workspaces list --no-private --json); do
72-
PACKAGE_DIR=../../$(echo $PACKAGE | jq -r '.location')
73-
PACKAGES_TO_INSTALL="$PACKAGES_TO_INSTALL $PACKAGE_DIR"
65+
for PACKAGE_DATA in $(pnpm ls -r --json --depth -1 | jq 'map(select(.private != true))' | jq -c '.[]'); do
66+
PACKAGE_PATH=$(echo $PACKAGE_DATA | jq -r '.path')
67+
PACKAGES_TO_INSTALL="$PACKAGES_TO_INSTALL file:$(realpath --relative-to=. "$PACKAGE_PATH")"
7468
done
69+
7570
echo "Installing packages: $PACKAGES_TO_INSTALL"
76-
yarn add --dev $PACKAGES_TO_INSTALL
71+
npm add --save-dev --install-links $PACKAGES_TO_INSTALL
7772
78-
- name: Ensure UX packages are installed from "${{ matrix.ux-packages-source == 'php-vendor' && 'vendor/symfony/ux-...' || '../../../src/**/assets' }}"
79-
working-directory: test_apps/encore-app
73+
- name: Ensure UX packages are installed from "${{ env.EXPECTED_PATTERN }}"
74+
working-directory: apps/encore
8075
run: |
81-
for PACKAGE in $(cat package.json | jq -c '(.dependencies // {}) + (.devDependencies // {}) | to_entries[] | select(.key | startswith("@symfony/ux-")) | {name: .key, version: .value}'); do
82-
PACKAGE_NAME=$(echo $PACKAGE | jq -r '.name')
83-
PACKAGE_VERSION=$(echo $PACKAGE | jq -r '.version')
76+
for PACKAGE_DATA in $(cat package.json | jq -c '(.dependencies // {}) + (.devDependencies // {}) | to_entries[] | select(.key | startswith("@symfony/ux-")) | {name: .key, version: .value}'); do
77+
PACKAGE=$(echo $PACKAGE_DATA | jq -r '.name')
78+
PACKAGE_VERSION=$(echo $PACKAGE_DATA | jq -r '.version')
8479
85-
echo -n "Checking $PACKAGE_NAME@$PACKAGE_VERSION..."
80+
echo -n "Checking $PACKAGE@$PACKAGE_VERSION..."
8681
if [[ $PACKAGE_VERSION == $EXPECTED_PATTERN* ]]; then
87-
echo " OK"
82+
echo " OK"
8883
else
89-
echo " KO"
90-
echo "The package version of $PACKAGE_NAME must starts with the pattern (e.g.: $EXPECTED_PATTERN), got $PACKAGE_VERSION instead."
84+
echo " KO"
85+
echo "ℹ️ The package version of $PACKAGE must starts with the pattern (e.g.: $EXPECTED_PATTERN), got $PACKAGE_VERSION instead."
9186
exit 1
9287
fi
9388
done;
9489
env:
95-
EXPECTED_PATTERN: ${{ matrix.ux-packages-source == 'php-vendor' && 'file:vendor/symfony/*' || '../../src/*' }}
90+
EXPECTED_PATTERN: ${{ matrix.ux-packages-source == 'php-vendor' && 'file:vendor/symfony/*' || 'file:../../src/*' }}
9691

97-
- name: Run Encore (dev)
98-
working-directory: test_apps/encore-app
99-
run: yarn encore dev
92+
- name: Ensure project can be built in dev mode
93+
working-directory: apps/encore
94+
run: npm run dev
10095

101-
- name: Run Encore (prod)
102-
working-directory: test_apps/encore-app
103-
run: yarn encore production
96+
- name: Ensure project can be built in prod mode
97+
working-directory: apps/encore
98+
run: npm run build
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: Browser Tests
2+
3+
defaults:
4+
run:
5+
shell: bash
6+
7+
on:
8+
push:
9+
paths-ignore:
10+
- 'src/*/doc/**'
11+
- 'src/**/*.md'
12+
- 'ux.symfony.com/**'
13+
- '.github/workflows/app-tests.yaml'
14+
- '.github/workflows/unit-tests.yaml'
15+
pull_request:
16+
paths-ignore:
17+
- 'src/*/doc/**'
18+
- 'src/**/*.md'
19+
- 'ux.symfony.com/**'
20+
- '.github/workflows/app-tests.yaml'
21+
- '.github/workflows/unit-tests.yaml'
22+
23+
concurrency:
24+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
25+
cancel-in-progress: true
26+
27+
jobs:
28+
test:
29+
runs-on: ubuntu-latest
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
symfony: ['6.4', '7.3']
34+
env:
35+
SYMFONY_REQUIRE: '${{ matrix.symfony }}.*'
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- run: npm i -g corepack && corepack enable
40+
- uses: actions/setup-node@v4
41+
with:
42+
node-version-file: '.nvmrc'
43+
cache: 'pnpm'
44+
cache-dependency-path: |
45+
pnpm-lock.yaml
46+
package.json
47+
48+
- name: Install root JS dependencies
49+
run: pnpm install --frozen-lockfile
50+
51+
- name: Install custom browsers
52+
run: node ./bin/get_browsers.mjs
53+
54+
- name: Install browsers with Playwright
55+
run: pnpm exec playwright install firefox ffmpeg
56+
57+
- uses: shivammathur/setup-php@v2
58+
with:
59+
php-version: 8.2
60+
tools: symfony-cli, flex
61+
62+
- name: Install root PHP dependencies
63+
uses: ramsey/composer-install@v3
64+
with:
65+
working-directory: ${{ github.workspace }}
66+
67+
- name: Build root packages
68+
run: php .github/build-packages.php
69+
70+
- name: Start Docker containers
71+
run: docker compose up -d --build
72+
working-directory: apps/e2e
73+
74+
- name: Configure E2E app
75+
run: |
76+
echo 'APP_ENV=prod' >> .env.local
77+
echo 'APP_DEBUG=0' >> .env.local
78+
echo 'APP_SECRET=df4c071596e64cc75a349456f2887ae2419ae650' >> .env.local
79+
working-directory: apps/e2e
80+
81+
- name: Install E2E PHP dependencies
82+
uses: ramsey/composer-install@v3
83+
with:
84+
working-directory: apps/e2e
85+
dependency-versions: highest
86+
composer-options: --no-dev
87+
custom-cache-suffix: symfony-${{ matrix.symfony }}
88+
89+
- name: Prepare E2E app
90+
run: |
91+
symfony composer dump-autoload --classmap-authoritative --no-dev
92+
symfony composer dump-env
93+
symfony console asset-map:compile
94+
symfony console ux:icons:warm-cache
95+
working-directory: apps/e2e
96+
97+
- name: Start E2E app
98+
run: symfony serve --daemon
99+
working-directory: apps/e2e
100+
101+
- name: Run browser tests
102+
run: pnpm run test:browser
103+
id: browser-tests
104+
105+
- uses: actions/upload-artifact@v4
106+
if: ${{ always() && steps.browser-tests.conclusion == 'failure' }}
107+
with:
108+
name: Playwright report and output (${{ matrix.symfony }})
109+
path: |
110+
src/**/assets/.playwright-report/
111+
src/**/assets/.playwright-output/
112+
retention-days: 7
113+
114+
- uses: actions/upload-artifact@v4
115+
if: ${{ always() && steps.browser-tests.conclusion == 'failure' }}
116+
with:
117+
name: Symfony logs (${{ matrix.symfony }})
118+
path: apps/e2e/var/log/
119+
retention-days: 7

0 commit comments

Comments
 (0)