[CalendarLink] Add component #278
Workflow file for this run
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 Encore | |
| on: | |
| push: | |
| branches-ignore: | |
| - 'dependabot/**' | |
| paths-ignore: | |
| - 'src/*/doc/**' | |
| - 'src/**/*.md' | |
| pull_request: | |
| paths-ignore: | |
| - 'src/*/doc/**' | |
| - 'src/**/*.md' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| 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@0c366fd6a839edf440554fa01a7085ccba70ac98 | |
| - run: npm i -g corepack && corepack enable | |
| - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f | |
| with: | |
| node-version-file: '.nvmrc' | |
| - uses: shivammathur/setup-php@690cb7c9d81dbfe51eba732cfca0a00ca42db777 | |
| - name: Install root PHP dependencies | |
| uses: ramsey/composer-install@5c2bcf28d7b060ef3c601d7b476d5430a7b46c27 | |
| with: | |
| working-directory: ${{ github.workspace }} | |
| - name: Build root PHP 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 app dependencies | |
| uses: ramsey/composer-install@5c2bcf28d7b060ef3c601d7b476d5430a7b46c27 | |
| 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 |