forked from elementor/elementor
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (68 loc) · 2.61 KB
/
screenshotter.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
name: Elementor-ScreenShotter
on: [ push, pull_request ]
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
run:
runs-on: ubuntu-20.04
timeout-minutes: 20
env:
screenshotter_config_path: ${{ github.workspace }}/tests/screenshotter/config.js
strategy:
fail-fast: false
matrix:
wordpress_versions: [ 'latest' ]
name: ScreenShotter - WordPress ${{ matrix.wordpress_versions }}
steps:
- name: Startup MySQL service
run: sudo systemctl start mysql.service
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
- name: Checkout source code
uses: actions/checkout@v3
- name: Install Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: 18.x
- name: Install Elementor-ScreenShotter
run: | ##### TO DO: Remove all sudo
sudo ln -sf /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm
sudo chown -R $USER /usr/local/lib/node_modules
sudo chown -R $USER /usr/local/bin/
npm i -g @elementor/screenshotter
npm i -g grunt-cli
- name: Install Dependencies
run: |
elementor-screenshotter-install --config=${screenshotter_config_path} --debug=true
- name: Prepare Test
run: | # Enable the container experiment & enable import SVG
cd /tmp/wordpress
wp elementor experiments activate container
wp elementor experiments activate nested-elements
wp option update elementor_unfiltered_files_upload 1
wp option update blogdescription 'Just another WordPress site' # WP >= 6.1
- name: Import Templates
run: |
elementor-screenshotter-import-templates --config=${screenshotter_config_path} --debug=true
- name: Build Package & Run Test
run: |
elementor-screenshotter-run-test --config=${screenshotter_config_path} --debug=true
- name: Clean up report data
if: failure()
run: |
npm i canvas@^2.8.0 merge-images@^2.0.0
node ./.github/scripts/screenshotter-cleanup.js
- uses: actions/upload-artifact@master
if: failure()
with:
name: backstop-output
path: /tmp/wordpress/backstop_data
- uses: actions/upload-artifact@master
if: failure()
with:
name: backstop-summary-core
path: /tmp/merged-screenshots