feature #3115 [Map][Google] Upgrade @googlemaps
/js-api-loader to ^2…
#1052
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: App Tests | |
on: | |
push: | |
paths-ignore: | |
- 'src/*/doc/**' | |
- 'src/**/*.md' | |
- 'ux.symfony.com/**' | |
pull_request: | |
paths-ignore: | |
- 'src/*/doc/**' | |
- 'src/**/*.md' | |
- 'ux.symfony.com/**' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
encore-app: | |
name: "Encore (${{ matrix.name}})" | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: Internal, from "vendor/" | |
ux-packages-source: php-vendor | |
- name: External, from "npm add" | |
ux-packages-source: js-packages | |
steps: | |
- uses: actions/checkout@v4 | |
- run: npm i -g corepack && corepack enable | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- uses: shivammathur/setup-php@v2 | |
- name: Install root dependencies | |
uses: ramsey/composer-install@v3 | |
with: | |
working-directory: ${{ github.workspace }} | |
- name: Build root packages | |
run: php .github/build-packages.php | |
# We always install PHP deps because of the UX Translator, which requires `var/translations` to exists | |
- name: Install PHP dependencies | |
uses: ramsey/composer-install@v3 | |
with: | |
working-directory: apps/encore | |
dependency-versions: highest | |
- working-directory: apps/encore | |
run: npm install --install-links | |
- if: matrix.ux-packages-source == 'js-packages' | |
name: Install UX JS packages with a JS package manager | |
working-directory: apps/encore | |
run: | | |
PACKAGES_TO_INSTALL='' | |
for PACKAGE_DATA in $(pnpm ls -r --json --depth -1 | jq 'map(select(.private != true))' | jq -c '.[]'); do | |
PACKAGE_PATH=$(echo $PACKAGE_DATA | jq -r '.path') | |
PACKAGES_TO_INSTALL="$PACKAGES_TO_INSTALL file:$(realpath --relative-to=. "$PACKAGE_PATH")" | |
done | |
echo "Installing packages: $PACKAGES_TO_INSTALL" | |
npm add --save-dev --install-links $PACKAGES_TO_INSTALL | |
- name: Ensure UX packages are installed from "${{ env.EXPECTED_PATTERN }}" | |
working-directory: apps/encore | |
run: | | |
for PACKAGE_DATA in $(cat package.json | jq -c '(.dependencies // {}) + (.devDependencies // {}) | to_entries[] | select(.key | startswith("@symfony/ux-")) | {name: .key, version: .value}'); do | |
PACKAGE=$(echo $PACKAGE_DATA | jq -r '.name') | |
PACKAGE_VERSION=$(echo $PACKAGE_DATA | jq -r '.version') | |
echo -n "Checking $PACKAGE@$PACKAGE_VERSION..." | |
if [[ $PACKAGE_VERSION == $EXPECTED_PATTERN* ]]; then | |
echo "✅ OK" | |
else | |
echo "❌ KO" | |
echo "ℹ️ The package version of $PACKAGE must starts with the pattern (e.g.: $EXPECTED_PATTERN), got $PACKAGE_VERSION instead." | |
exit 1 | |
fi | |
done; | |
env: | |
EXPECTED_PATTERN: ${{ matrix.ux-packages-source == 'php-vendor' && 'file:vendor/symfony/*' || 'file:../../src/*' }} | |
- name: Ensure project can be built in dev mode | |
working-directory: apps/encore | |
run: npm run dev | |
- name: Ensure project can be built in prod mode | |
working-directory: apps/encore | |
run: npm run build |