Skip to content

Commit 5410735

Browse files
authored
Merge branch '2.x' into icons-color
2 parents 0d2a283 + 405251f commit 5410735

File tree

1,297 files changed

+49936
-29754
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,297 files changed

+49936
-29754
lines changed

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
; top-most EditorConfig file
2+
root = true
3+
4+
; Unix-style newlines
5+
[*]
6+
charset = utf-8
7+
end_of_line = LF
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.{php,html,twig}]
12+
indent_style = space
13+
indent_size = 4
14+
15+
[*.md]
16+
max_line_length = 80
17+
18+
[COMMIT_EDITMSG]
19+
max_line_length = 0

.gitattributes

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

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
src/LazyImage @Kocal
22
src/Map @Kocal
3+
src/Toolkit @Kocal
34
src/Translator @Kocal

.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: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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() {
5+
local ok=0
6+
local title="$1"
7+
local start=$(date -u +%s)
8+
OUTPUT=$(bash -xc "$2" 2>&1) || ok=$?
9+
local end=$(date -u +%s)
10+
11+
if [[ $ok -ne 0 ]]; then
12+
printf "\n%-70s%10s\n" $title $(($end-$start))s
13+
echo "$OUTPUT"
14+
echo "Job exited with: $ok"
15+
echo -e "\n::error::KO $title\\n"
16+
else
17+
printf "::group::%-68s%10s\n" $title $(($end-$start))s
18+
echo "$OUTPUT"
19+
echo -e "\n\\e[32mOK\\e[0m $title\\n\\n::endgroup::"
20+
fi
21+
22+
return $ok
23+
}
24+
export -f _run_task_sequential
25+
26+
_run_task() {
27+
_run_task_sequential "$1" "$2"
28+
exit $?
29+
}
30+
export -f _run_task
31+
32+
install_property_info_for_version() {
33+
local php_version="$1"
34+
local min_stability="$2"
35+
36+
if [ "$php_version" = "8.2" ]; then
37+
composer require symfony/property-info:7.1.* symfony/type-info:7.2.*
38+
elif [ "$php_version" = "8.3" ]; then
39+
composer require symfony/property-info:7.2.* symfony/type-info:7.2.*
40+
elif [ "$php_version" = "8.4" ] && [ "$min_stability" = "stable" ]; then
41+
composer require symfony/property-info:7.3.* symfony/type-info:7.3.*
42+
elif [ "$php_version" = "8.4" ] && [ "$min_stability" = "dev" ]; then
43+
composer require symfony/property-info:>=7.3 symfony/type-info:>=7.3
44+
fi
45+
}
46+
export -f install_property_info_for_version

.github/workflows/app-tests.yaml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: App Tests
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- 'src/*/doc/**'
7+
- 'src/**/*.md'
8+
- 'ux.symfony.com/**'
9+
pull_request:
10+
paths-ignore:
11+
- 'src/*/doc/**'
12+
- 'src/**/*.md'
13+
- 'ux.symfony.com/**'
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
encore-app:
21+
name: "Encore (${{ matrix.name}})"
22+
runs-on: ubuntu-latest
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
include:
27+
- name: Internal, from "vendor/"
28+
ux-packages-source: php-vendor
29+
- name: External, from "npm add"
30+
ux-packages-source: js-packages
31+
steps:
32+
- uses: actions/checkout@v4
33+
34+
- run: npm i -g corepack && corepack enable
35+
36+
- uses: actions/setup-node@v4
37+
with:
38+
node-version-file: '.nvmrc'
39+
40+
- uses: shivammathur/setup-php@v2
41+
42+
- name: Install root dependencies
43+
uses: ramsey/composer-install@v3
44+
with:
45+
working-directory: ${{ github.workspace }}
46+
47+
- name: Build root packages
48+
run: php .github/build-packages.php
49+
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
56+
57+
- working-directory: apps/encore
58+
run: npm install --install-links
59+
60+
- if: matrix.ux-packages-source == 'js-packages'
61+
name: Install UX JS packages with a JS package manager
62+
working-directory: apps/encore
63+
run: |
64+
PACKAGES_TO_INSTALL=''
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")"
68+
done
69+
70+
echo "Installing packages: $PACKAGES_TO_INSTALL"
71+
npm add --save-dev --install-links $PACKAGES_TO_INSTALL
72+
73+
- name: Ensure UX packages are installed from "${{ env.EXPECTED_PATTERN }}"
74+
working-directory: apps/encore
75+
run: |
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')
79+
80+
echo -n "Checking $PACKAGE@$PACKAGE_VERSION..."
81+
if [[ $PACKAGE_VERSION == $EXPECTED_PATTERN* ]]; then
82+
echo "✅ OK"
83+
else
84+
echo "❌ KO"
85+
echo "ℹ️ The package version of $PACKAGE must starts with the pattern (e.g.: $EXPECTED_PATTERN), got $PACKAGE_VERSION instead."
86+
exit 1
87+
fi
88+
done;
89+
env:
90+
EXPECTED_PATTERN: ${{ matrix.ux-packages-source == 'php-vendor' && 'file:vendor/symfony/*' || 'file:../../src/*' }}
91+
92+
- name: Ensure project can be built in dev mode
93+
working-directory: apps/encore
94+
run: npm run dev
95+
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)