-
Notifications
You must be signed in to change notification settings - Fork 212
86 lines (74 loc) · 4 KB
/
performance-metrics.yml
File metadata and controls
86 lines (74 loc) · 4 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
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 }}