-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (66 loc) · 2.43 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
79
name: E2E Cypress Tests
on:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
jobs:
build:
uses: mailchimp/wordpress/.github/workflows/build-release-zip.yml@develop
cypress:
needs: build
name: ${{ matrix.core.name }}
runs-on: ubuntu-latest
env:
CYPRESS_MAILCHIMP_USERNAME: ${{ secrets.MAILCHIMP_USERNAME }}
CYPRESS_MAILCHIMP_PASSWORD: ${{ secrets.MAILCHIMP_PASSWORD }}
strategy:
matrix:
core:
- {name: 'WP latest', version: 'latest'}
- {name: 'WP minimum', version: 'WordPress/WordPress#6.1'}
- {name: 'WP trunk', version: 'WordPress/WordPress#master'}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download build zip
uses: actions/download-artifact@v4
with:
name: ${{ github.event.repository.name }}
path: ${{ github.event.repository.name }}
- name: Display structure of downloaded files
run: ls -R
working-directory: ${{ github.event.repository.name }}
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
- name: Set the core version and plugins config
run: ./tests/bin/set-core-version.js --core=${{ matrix.core.version }} --plugins=./${{ github.event.repository.name }}
- name: Set up WP environment
run: npm run env:start
- name: Test
run: npm run cypress:run
- name: Update summary
if: always()
run: |
npx mochawesome-merge ./tests/cypress/reports/*.json -o tests/cypress/reports/mochawesome.json
rm -rf ./tests/cypress/reports/mochawesome-*.json
npx mochawesome-json-to-md -p ./tests/cypress/reports/mochawesome.json -o ./tests/cypress/reports/mochawesome.md -t ./node_modules/mochawesome-json-to-md/sample-template.md
npx mochawesome-report-generator tests/cypress/reports/mochawesome.json -o tests/cypress/reports/
cat ./tests/cypress/reports/mochawesome.md >> $GITHUB_STEP_SUMMARY
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-artifact-mailchimp
retention-days: 7
path: |
${{ github.workspace }}/tests/cypress/screenshots/
${{ github.workspace }}/tests/cypress/videos/
${{ github.workspace }}/tests/cypress/logs/
${{ github.workspace }}/tests/cypress/reports/