-
Notifications
You must be signed in to change notification settings - Fork 212
99 lines (86 loc) · 4.58 KB
/
performance-metrics.yml
File metadata and controls
99 lines (86 loc) · 4.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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: |-
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: use the other generate_app action that has more flexibility
# - 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: Generate Retail App Private Client
uses: ./.github/actions/generate_app
with:
use_extensibility: false
is_private_client: true
setup_hybrid: false
project_dir: 'build'
project_id: 'FOOOOOOOOOOOOOOOOOO'
org_id: 'f_ecom_tbbn_prd'
short_code: 'performance-001'
client_id: '9629ef22-f8b8-4987-90ac-b815be3940c8'
site_id: 'SiteNemesis'
instance_url: 'zzrf-001.dx.commercecloud.salesforce.com' # this doesn't matter because the OCAPI proxy in Runtime Admin will take precedence
# TODO: is this step still needed? I think it expects a project key
# - 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 }}