chore(deps): bump the npm_and_yarn group across 15 directories with 13 updates #455
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: Sample Apps Verification | |
| on: | |
| pull_request: | |
| branches: ['develop'] | |
| types: ['opened', 'synchronize', 'reopened'] | |
| paths: | |
| - 'examples/**' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| NODE_OPTIONS: '--no-warnings' | |
| permissions: | |
| contents: read | |
| jobs: | |
| # Detect affected sample apps | |
| detect-apps: | |
| name: Detect Affected Sample Apps | |
| runs-on: ubuntu-latest | |
| outputs: | |
| affected-apps: ${{ steps.detect.outputs.affected-apps }} | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Detect affected sample apps | |
| id: detect | |
| run: | | |
| # Get changed files in examples directory | |
| CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep "^examples/" || true) | |
| if [[ -z "$CHANGED_FILES" ]]; then | |
| echo "No sample app changes detected" | |
| echo "affected-apps=[]" >> $GITHUB_OUTPUT | |
| exit 0 | |
| fi | |
| # Extract unique app directories | |
| AFFECTED_DIRS=$(echo "$CHANGED_FILES" | xargs -r dirname | sort -u) | |
| # Build JSON array of affected apps | |
| APPS_JSON="[" | |
| FIRST=true | |
| while IFS= read -r dir; do | |
| # Exclude mock-servers directory | |
| if [[ "$dir" == *"examples/utils/mock-servers"* ]]; then | |
| continue | |
| fi | |
| # Check if package.json exists in the directory | |
| if [[ ! -f "$dir/package.json" ]]; then | |
| continue | |
| fi | |
| if [[ "$FIRST" != "true" ]]; then | |
| APPS_JSON+="," | |
| fi | |
| APPS_JSON+="{\"path\":\"$dir\",\"name\":\"$(basename $dir)\"}" | |
| FIRST=false | |
| done <<< "$AFFECTED_DIRS" | |
| APPS_JSON+="]" | |
| echo "Affected apps: $APPS_JSON" | |
| echo "affected-apps=$APPS_JSON" >> $GITHUB_OUTPUT | |
| # Run build and verification for affected sample apps in parallel | |
| verify-sample-apps: | |
| name: Build and Verify Sample App | |
| runs-on: ubuntu-latest | |
| needs: detect-apps | |
| if: needs.detect-apps.outputs.affected-apps != '[]' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| app: ${{ fromJson(needs.detect-apps.outputs.affected-apps) }} | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'npm' | |
| cache-dependency-path: '${{ matrix.app.path }}/package-lock.json' | |
| - name: Setup Mock Servers | |
| working-directory: examples/utils/mock-servers | |
| run: npm install | |
| - name: Install dependencies | |
| working-directory: ${{ matrix.app.path }} | |
| run: npm run setup:ci | |
| - name: Build app | |
| working-directory: ${{ matrix.app.path }} | |
| run: npm run build | |
| - name: Verify app startup | |
| working-directory: ${{ matrix.app.path }} | |
| run: npm run verify | |
| # Summary job that aggregates results | |
| verification-summary: | |
| name: Sample Apps Verification Summary | |
| runs-on: ubuntu-latest | |
| needs: [detect-apps, verify-sample-apps] | |
| if: always() | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | |
| with: | |
| egress-policy: audit | |
| - name: Summary | |
| run: | | |
| if [[ "${{ needs.detect-apps.outputs.affected-apps }}" == "[]" ]]; then | |
| echo "✅ No sample apps affected by changes" | |
| exit 0 | |
| fi | |
| if [[ "${{ needs.verify-sample-apps.result }}" == "success" ]]; then | |
| echo "✅ All affected sample apps built and verified successfully" | |
| elif [[ "${{ needs.verify-sample-apps.result }}" == "failure" ]]; then | |
| echo "❌ Some sample apps failed build or verification" | |
| exit 1 | |
| elif [[ "${{ needs.verify-sample-apps.result }}" == "skipped" ]]; then | |
| echo "⏭️ Sample app verification was skipped" | |
| else | |
| echo "⚠️ Sample app verification completed with status: ${{ needs.verify-sample-apps.result }}" | |
| fi |