Disable some steps that are not needed #1
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: SalesforceCommerceCloud/pwa-kit/performance-metrics | ||
| on: | ||
| workflow_dispatch: # Allows you to manually run the workflow on any branch. | ||
| schedule: | ||
| # Run every day at 12am (PST) - cron uses UTC times. | ||
| # Runs on the default branch. | ||
| # - cron: '0 8 * * *' | ||
| jobs: | ||
| run-performance-metrics: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| cache: npm | ||
| - name: Install Monorepo Dependencies | ||
| run: |- | ||
| # Install node dependencies | ||
| node ./scripts/gtime.js monorepo_install npm ci | ||
| - name: Get Template Version | ||
| run: |- | ||
| version=`jq -r ".version" packages/template-retail-react-app/package.json` | ||
| echo "retail_app_template_version=$version" >> "$GITHUB_ENV" | ||
| # TODO: This is set to generate an app with extensibility using a SLAS private client which I don't know is what they'll be running tests on. | ||
| # TODO: Change this to generate an app with the performance metrics template. | ||
| - name: Generate Retail App Private Client | ||
| uses: ./.github/actions/e2e_generate_app | ||
| with: | ||
| PROJECT_KEY: 'retail-app-private-client' | ||
| TEMPLATE_VERSION: ${{ env.retail_app_template_version }} | ||
| - name: Validate Generated Retail App Private Client | ||
| uses: ./.github/actions/e2e_validate_generated_app | ||
| with: | ||
| PROJECT_KEY: 'retail-app-private-client' | ||
| TEMPLATE_VERSION: ${{ env.retail_app_template_version }} | ||
| - name: Create MRT credentials file | ||
| uses: './.github/actions/create_mrt' | ||
| with: | ||
| mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }} | ||
| mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }} | ||
| - name: Push Bundle to MRT | ||
| uses: './.github/actions/push_to_mrt' | ||
| with: | ||
| CWD: '../generated-projects/retail-app-private-client' | ||
| TARGET: e2e-pwa-kit-private | ||
| FLAGS: --wait | ||
| # TODO: Remove this if not needed or change this to whatever storefront is used for performance metrics. | ||
| - name: Set Retail App Private Client Home | ||
| run: export RETAIL_APP_HOME=https://scaffold-pwa-e2e-pwa-kit-private.mobify-storefront.com/ | ||
| # TODO: This step is not needed. We don't need to worry about calling it from the workflow. What we need to worry about is the build and deploy to MRT. | ||
| # - name: Run Performance Metrics | ||
| # run: npm run test:performance-metrics # TODO: Replace with whatever command is used for performance metrics. | ||
| # Optionally send Slack notifications for performance metrics. | ||
| notify-slack-performance-metrics: | ||
| needs: [run-performance-metrics] # Makes sure the performance metrics job has completed before running this job. | ||
| if: ${{ always() }} # Runs this job even if the performance metrics job fails. | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Send GitHub Action data to Slack workflow (Generated) | ||
| id: slack-success | ||
| if: ${{ github.event_name == 'schedule' && needs.run-performance-metrics.result == 'success' }} | ||
| uses: slackapi/slack-github-action@v1.23.0 | ||
| with: | ||
| payload: | | ||
| { | ||
| "message": "✅ All PWA Kit Private Client Performance Metrics tests passed!" | ||
| } | ||
| env: | ||
| # TODO: Create a new slack webhook from the performance metrics slack channel. | ||
| # Add the webhook url to the repository secrets with as SLACK_PERFORMANCE_METRICS_WEBHOOK_URL key. | ||
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_PERFORMANCE_METRICS_WEBHOOK_URL }} | ||