Skip to content

Commit 107d882

Browse files
committed
minor #2614 [CI] Refactor some steps in test-app-encore-app job (Kocal)
This PR was merged into the 2.x branch. Discussion ---------- [CI] Refactor some steps in test-app-encore-app job | Q | A | ------------- | --- | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - For new features, provide some code snippets to help understand usage. - Features and deprecations must be submitted against branch main. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> Follow #2613 Commits ------- 365888a [CI] Refactor some steps in test-app-encore-app job
2 parents 0c66d96 + 365888a commit 107d882

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

.github/workflows/test.yaml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ jobs:
154154
- name: External, from "npm add"
155155
ux-packages-source: js-packages
156156
steps:
157-
# Setup
158157
- uses: actions/checkout@v4
159158

160159
- run: corepack enable
@@ -179,12 +178,22 @@ jobs:
179178
run: php .github/build-packages.php
180179
working-directory: ${{ github.workspace }}
181180

181+
# We always install PHP deps because we of the UX Translator, which requires `var/translations` to exists
182182
- uses: ramsey/composer-install@v3
183183
with:
184184
dependency-versions: 'highest'
185185
working-directory: test_apps/encore-app
186186

187+
- if: matrix.ux-packages-source == 'php-vendor'
188+
name: Refresh dependencies from vendor/
189+
working-directory: test_apps/encore-app
190+
run: yarn
191+
env:
192+
YARN_ENABLE_HARDENED_MODE: 0
193+
YARN_ENABLE_IMMUTABLE_INSTALLS: 0
194+
187195
- if: matrix.ux-packages-source == 'js-packages'
196+
name: Install UX JS packages with a JS package manager
188197
working-directory: test_apps/encore-app
189198
run: |
190199
PACKAGES_TO_INSTALL=''
@@ -195,7 +204,6 @@ jobs:
195204
echo "Installing packages: $PACKAGES_TO_INSTALL"
196205
yarn add --dev $PACKAGES_TO_INSTALL
197206
198-
# Validations
199207
- name: Ensure UX packages are installed from "${{ matrix.ux-packages-source == 'php-vendor' && 'vendor/symfony/ux-...' || '../../../src/**/assets' }}"
200208
working-directory: test_apps/encore-app
201209
run: |
@@ -215,9 +223,10 @@ jobs:
215223
env:
216224
EXPECTED_PATTERN: ${{ matrix.ux-packages-source == 'php-vendor' && 'file:vendor/symfony/*' || '../../src/*' }}
217225

218-
- name: Run Encore
226+
- name: Run Encore (dev)
219227
working-directory: test_apps/encore-app
220-
run: |
221-
YARN_ENABLE_HARDENED_MODE=0 YARN_ENABLE_IMMUTABLE_INSTALLS=0 yarn || (echo "Unable to install Yarn dependencies" && exit 1)
222-
yarn encore dev || (echo "Unable to build Encore assets (dev)" && exit 1)
223-
yarn encore production || (echo "Unable to build Encore assets (production)" && exit 1)
228+
run: yarn encore dev
229+
230+
- name: Run Encore (prod)
231+
working-directory: test_apps/encore-app
232+
run: yarn encore production

0 commit comments

Comments
 (0)