forked from Automattic/vip-go-mu-plugins
-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (70 loc) · 2.25 KB
/
e2e.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
name: Run e2e tests
on:
pull_request:
workflow_dispatch:
inputs:
wpversion:
description: 'WordPress version to run tests against'
required: false
default: 'latest'
url:
description: 'Alternative Test URL'
required: false
default: ''
user:
description: 'Alternative User Name'
required: false
default: ''
password:
description: 'Alternative Password'
required: false
default: ''
jobs:
Run_e2e_tests:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
with:
submodules: true
path: vip-go-mu-plugins
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '16'
cache: npm
cache-dependency-path: vip-go-mu-plugins/package-lock.json
- name: Install dependencies
run: npm ci
working-directory: vip-go-mu-plugins
- name: Install VIP CLI
run: npm install --prefix=$HOME/.local -g @automattic/vip
- name: Determine WP version
id: wpver
run: |
if [ -z "${{ github.event.inputs.wpversion }}" ]; then
echo ::set-output name=wpversion::latest
else
echo ::set-output name=wpversion::${{ github.event.inputs.wpversion }}
fi
- name: Setup test environment
if: ${{ github.event.inputs.url == '' }}
run: npm run setup-e2e-env -- -v ${{ steps.wpver.outputs.wpversion }}
working-directory: vip-go-mu-plugins
- name: Setup test env variables
if: ${{ github.event.inputs.url != '' }}
run: |
echo "E2E_BASE_URL=${{ github.event.inputs.url }}" >> $GITHUB_ENV
echo "E2E_USER=${{ github.event.inputs.user }}" >> $GITHUB_ENV
echo "E2E_PASSWORD=${{ github.event.inputs.password }}" >> $GITHUB_ENV
- name: Run e2e tests
run: npm run test-e2e
working-directory: vip-go-mu-plugins
- name: Archive test results
uses: actions/upload-artifact@v2
if: failure()
with:
name: test-results
path: |
vip-go-mu-plugins/test-results
vip-go-mu-plugins/screenshots