-
Notifications
You must be signed in to change notification settings - Fork 800
132 lines (111 loc) · 4.06 KB
/
block-performance.yml
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Jetpack block performance
on:
schedule:
- cron: '0 */12 * * *'
workflow_dispatch:
jobs:
block-performance:
name: "Performance tests"
runs-on: ubuntu-latest
timeout-minutes: 90 # 2023-04-18: Some runs exceeded 50 minutes
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/checkout@v4
with:
repository: 'WordPress/gutenberg'
path: 'gutenberg'
- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('gutenberg/**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Build Gutenberg
working-directory: gutenberg
run: |
npm ci
npx playwright install chromium --with-deps
npm run build:packages
- name: Setup tools for Jetpack
uses: ./.github/actions/tool-setup
- name: Build Production Jetpack
run: |
pnpm install
pnpm jetpack build plugins/jetpack -v --production
- name: Environment set-up
working-directory: tools/e2e-commons
env:
CONFIG_KEY: ${{ secrets.E2E_CONFIG_KEY }}
run: |
# Gutenberg Performance tests require disable-animations.php test
# plugin to be available on a site. Below we inject the mapping for
# that plugin into a Docker config file.
echo "e2e:" >> ../docker/jetpack-docker-config.yml
echo " volumeMappings:" >> ../docker/jetpack-docker-config.yml
echo " gutenberg/packages/e2e-tests/plugins/disable-animations.php: /var/www/html/wp-content/plugins/disable-animations.php" >> ../docker/jetpack-docker-config.yml
mkdir results
pnpm config:decrypt
pnpm env:start
# The twentytwentyone theme is required for the post-editor test suite.
pnpm jetpack docker --type e2e --name t1 wp theme install twentytwentyone
- name: Run performance tests
working-directory: tools/e2e-commons
run: |
node ./bin/performance.js
- name: Environment tear-down
if: ${{ always() }}
working-directory: tools/e2e-commons
continue-on-error: true
run: |
pnpm run tunnel:off
# Update permissions to workaround https://github.com/actions/cache/issues/753
sudo chown -R runner:docker "$GITHUB_WORKSPACE/tools/docker"
- name: Upload test artifacts
if: ${{ always() }}
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: test-output-block-perf
path: tools/e2e-commons/results
include-hidden-files: true
test-reports:
name: "Trigger test report workflow"
runs-on: ubuntu-latest
if: ${{ ! cancelled() }}
needs: block-performance
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.E2E_TEST_REPORTS_TOKEN }}
repository: automattic/jetpack-e2e-reports
event-type: block-perf
client-payload: '{"run_id": "${{github.run_id}}", "repository": "${{github.repository}}"}'
slack-notification:
name: "Slack notification"
runs-on: ubuntu-latest
if: ${{ ! cancelled() }}
needs: [block-performance]
steps:
- uses: actions/checkout@v4
- name: Set up tools
uses: ./.github/actions/tool-setup
- name: Build action
env:
COMPOSER_ROOT_VERSION: dev-trunk
run: |
pnpm install
composer install
composer build-development
working-directory: ./projects/github-actions/test-results-to-slack
- name: "Send notification"
uses: ./projects/github-actions/test-results-to-slack
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
slack_token: ${{ secrets.SLACK_TOKEN }}
slack_channel: ${{ secrets.SLACK_E2E_CHANNEL }}
slack_icon_emoji: ":jetpack:"
suite_name: "blocks performance"